Apache htaccess错误导致循环
我试图在HTACCESS文件上强制使用SSL,所有的努力都会导致index.php上出现一个循环 这是我的访问权限Apache htaccess错误导致循环,apache,.htaccess,mod-rewrite,ssl,Apache,.htaccess,Mod Rewrite,Ssl,我试图在HTACCESS文件上强制使用SSL,所有的努力都会导致index.php上出现一个循环 这是我的访问权限 <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
重新启动发动机
重写基/
重写规则^index\.php$-[L]
重写cond%{REQUEST_FILENAME}-F
重写cond%{REQUEST_FILENAME}-D
重写规则/index.php[L]
我的站点可以很好地使用它,但没有SSL
我尝试了以下方法:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^(.*)$ https://www.fakedomainlollol.com/$1 [R,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
重新启动发动机
重写基/
重写规则^(.*)$https://www.fakedomainlollol.com/$1[R,L]
重写cond%{REQUEST_FILENAME}-F
重写cond%{REQUEST_FILENAME}-D
重写规则/index.php[L]
更新后的重写规则以循环方式发送站点
错误是什么?我做错了什么?您的第一条规则是将https重定向到https,这就是为什么循环。将这一行放在规则RewriteCond%{https}^off$上方,以便只有http请求可以路由到https,而不是https=>https。