2

我想强制我网站上的每个页面都使用 SSL (https),​​除了主页 index.php 使用 .htccess

4

1 回答 1

1

在文档根目录的 htaccess 文件中,添加以下规则:

RewriteEngine On
RewriteCond %{HTTPS} !on
RewriteCond %{REQUEST_URI} !^/(index.php)?$ 
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R]
于 2012-10-01T18:39:36.750 回答