【发布时间】:2015-12-14 06:04:12
【问题描述】:
如果 cookie 未设置为 htaccess,我会尝试重定向,但我无法阻止重定向循环。
这是为了安装wordpress。
这是我现在的.htaccess:
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_COOKIE} !^cookie_name[NC]
RewriteCond %{REQUEST_URI} !^/page_to_redirect/ [NC]
RewriteRule .* /page_to_redirect/ [R,L]
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
我该怎么做?
【问题讨论】:
-
尝试使用
RewriteCond %{HTTP_COOKIE} !cookie_name [NC],不使用^并添加一个空格,因为您的cookie不一定是第一个。 -
重定向循环持续存在。谢谢!
标签: php wordpress .htaccess redirect cookies