apache设置http跳转到https


开通https后如果强制所有连接都使用https可以在相应域名80端口的vhosts下填写如下语句:

     RewriteEngine on
     RewriteCond %{SERVER_PORT} !^443$
     RewriteRule ^(.*)?$ https://%{SERVER_NAME}$1 [L,R]

 

Archives