0

我收到重定向错误:Firefox has detected that the server is redirecting the request for this address in a way that will never complete.我的 .htaccess 文件中有以下内容:

RewriteEngine on
RewriteBase /

RewriteCond %{HTTPS} !=on
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI}/test/ [L,R]

当我加载http://www.mysite.com或被https://www.mysite.com重定向到:

https://www.mysite.com/test//test//test//test//test//test/......

似乎RewriteCond没有将 https 识别为打开并不断加载该重写规则。

为什么设置 https 时这个条件不会失败?

4

1 回答 1

0

以下似乎解决了我的问题:

RewriteCond %{ENV:HTTPS} !on [NC]

于 2013-07-08T17:26:59.630 回答