自动把http访问转为https

在Apache的http虚拟主机设置中添加如下代码即可:

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

 

发表评论