2013-02-19 58 views
0

我需要PHP从URL获得一个变量,即使mod_rewrite设置。

国防部重写如下

<IfModule mod_rewrite.c> 
    RewriteEngine On 
    RewriteBase /*********/ 

    RewriteCond %{REQUEST_FILENAME} !-f 
    RewriteCond %{REQUEST_FILENAME} !-d 


    #RewriteRule ^(.*)$ index.php/$1 
    RewriteRule ^(.*)$ /index.php?/$1 

</IfModule> 

URL示例:www.example.com/something/somthing/?search=something

我的网站上它不读取$ _GET varible搜索在所有

+0

通常是'[QSA]'标志。 – mario 2013-02-19 03:13:33

回答

0

[QSA]加到RewriteRule行的末尾。代表Q用户S tring 一个 ppend,它完全按照它的说法并将任何以前的查询字符串追加到重写的地址。

+0

谢谢,解决了我的问题! – user2067005 2013-02-19 03:21:24

+0

我已经低估了这一点,因为这是一个浅的答案,因此看起来像repwhoring。特别是根据足够的重复:http://stackoverflow.com/questions/14763112/mod-rewrite-and-facebook-get-variables/14763142#14763142 – mario 2013-02-19 03:25:34

+0

马里奥,那里的链接不会帮助我,因为事实上他有不同的问题 – user2067005 2013-02-19 03:34:04