vim /etc/httpd/conf/httpd.conf
新增如下三行
RewriteEngine on
RewriteCond %{HTTPS} !=on
RewriteRule ^(.*) https://%{SERVER_NAME}$1 [L,R]
重启Apache即可
systemctl restart httpd.service
vim /etc/httpd/conf/httpd.conf
新增如下三行
RewriteEngine on
RewriteCond %{HTTPS} !=on
RewriteRule ^(.*) https://%{SERVER_NAME}$1 [L,R]
重启Apache即可
systemctl restart httpd.service