Apache重写破坏了PHP超全局

Apache重写破坏了PHP超全局,php,apache,mod-rewrite,Php,Apache,Mod Rewrite,我有一个很奇怪的谜。我有一个相当简单的Apache重写,出于某种奇怪的原因,它正在打乱我的php超全局。首先,重写如下: <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule ^(.*)$ index.php?/$1 [L] </IfModule> 这将为我提供$\u GET superglobal,key:item,value:id。非常感谢您的帮助。您需要在重

我有一个很奇怪的谜。我有一个相当简单的Apache重写,出于某种奇怪的原因,它正在打乱我的php超全局。首先,重写如下:

<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /

    RewriteRule ^(.*)$ index.php?/$1 [L]
</IfModule>

这将为我提供$\u GET superglobal,key:item,value:id。非常感谢您的帮助。

您需要在重写规则中传递原始查询字符串:

RewriteRule ^(.*)$ index.php?/$1 [L,QSA]
                                    ^^^
这样,不管将来可能添加哪些新值,旧值也会被传递

URL: localhost/users/dashboard?item=id 
RewriteRule ^(.*)$ index.php?/$1 [L,QSA]
                                    ^^^