Apache 使用.htccess强制SSL,主页index.php上除外

Apache 使用.htccess强制SSL,主页index.php上除外,apache,.htaccess,http,Apache,.htaccess,Http,我想强制我的网站上的每个页面使用SSL(https),除了homepage index.php使用.htccess,在文档根目录的htaccess文件中,添加以下规则: RewriteEngine On RewriteCond %{HTTPS} !on RewriteCond %{REQUEST_URI} !^/(index.php)?$ RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R]

我想强制我的网站上的每个页面使用SSL(https),除了homepage index.php使用.htccess,在文档根目录的htaccess文件中,添加以下规则:

RewriteEngine On
RewriteCond %{HTTPS} !on
RewriteCond %{REQUEST_URI} !^/(index.php)?$ 
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R]