centos下配置Apache的https强制跳转
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