【发布时间】:2013-02-25 17:50:25
【问题描述】:
我的 htaccess 中有以下规则
RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule .+ redirect.php [L]
RewriteRule ^(.*)\.(?!js|css|png)([^.]*)$ redirect.php [L]
一切都很完美,除了一件事,查询字符串。
由于某种原因,查询字符串消失了......
我得到了以下网址 myweb.com/subscribe?email=blablabla 在 redirect.php 我有以下行:
echo $_GET['email']; //should echo the email
它没有回显任何东西...
*我检查它确实重写为redirect.php
任何想法为什么以及如何解决它?
【问题讨论】:
-
QSA 标志不起作用。我什么都试过了……
-
请注意,您有 2 条规则,使用
QSA,这是正确答案,在这两个规则中。 -
@Wrikken ofc,我两个都做了,但没用。我不是那个白痴而已
-
让我们明确一点,
QSA(或 Leonard 对此的回答)有效,所以必须有其他事情发生。更多的重定向可能在某个地方?您可以暂时将重定向设置为外部 ([R]),以在浏览器的网络日志中检查发生的情况和情况。
标签: php apache .htaccess mod-rewrite get