http://zhumeng8337797.blog.163.com/blog/static/100768914201072051336303/
如果要针对整个网站全部执行HTTP自动转为HTTPS的功能,可以在httpd.conf文件中,增加:
RewriteEngine on
RewriteCond %{HTTPS} !=on
RewriteRule ^(.*) https://%{SERVER_NAME}$1 [L,R]
如果,仅要求对\secure目录下的内容强制采用HTTPS访问,可以在httpd.conf文件中加入如下语句:
<Directory "C:\Program Files\htdocs\secure">
RewriteEngine on
RewriteCond %{HTTPS} !=on
RewriteRule ^(.*) https://%{SERVER_NAME}/secure/$1 [L,R]
</Directory>
转载于:https://blog.51cto.com/fccwcom/1567340