apache实现http重定向到https

作者:简简单单 2013-11-13

老谢目前做了一个新站,全站采用https协议访问,所以需要http重定向到https,只需要在.htaccess加入下面规则既可:

 代码如下 复制代码

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

代码来自:301 redirect from http to https (6 posts)

相关文章

精彩推荐