.htaccess - ERR_TOO_MANY_REDIRECTS

时间:2015-02-28 09:35:54

标签: .htaccess

我正在使用此.htaccess在我的网址示例末尾添加日期,小时,分钟:

example.com/pagename?201502201855   

它适用于我的所有帖子和页面,但如果我导航到页码2,3,4,5,6示例

example.com/page/2/?201502211929

然后我收到错误:此网页有重定向循环错误代码:ERR_TOO_MANY_REDIRECTS

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /


RewriteCond %{QUERY_STRING} ^$
RewriteRule ^(?!wp-admin)^(?!wp-login.php) %{REQUEST_URI}?%{TIME_YEAR}%{TIME_MON}%{TIME_DAY}%{TIME_HOUR}%{TIME_MIN} [L,R=302,NE]

RewriteCond %{TIME_YEAR}%{TIME_MON}##%{QUERY_STRING} ^([^#]+)##\1
RewriteCond %{TIME_YEAR}%{TIME_MON}%{TIME_DAY}%{TIME_HOUR}%{TIME_MIN}##%{QUERY_STRING} !^([^#]+)##\1
RewriteRule ^(?!wp-admin)^(?!wp-login.php) %{REQUEST_URI}?%{TIME_YEAR}%{TIME_MON}%{TIME_DAY}%{TIME_HOUR}%{TIME_MIN} [L,R=302,NE]
</IfModule>

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

1 个答案:

答案 0 :(得分:2)

.htaccess文件中,添加以下行:

SetEnvIf X-Forwarded-Proto https HTTPS=on