2014-09-02 15 views
0

我有一個搜索功能來查找產品,還我已啓用內.htaccessPHP的問題,同時發送與國防部重寫形式得到啓用

RewriteRule ^(.*)$ https://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301] 
RewriteRule ^([A-Za-z0-9_-]+)$ /index.php?go=$1 
RewriteRule ^([A-Za-z0-9_-]+)/([A-Za-z0-9_-]+)$ /index.php?go=$1&action=$2 
RewriteRule ^([A-Za-z0-9_-]+)/([A-Za-z0-9_-]+)/([A-Za-z0-9_-]+)$ /index.php?go=$1&action=$2&do=$3 
RewriteRule ^([A-Za-z0-9_-]+)/([A-Za-z0-9_-]+)/([A-Za-z0-9_-]+)/([A-Za-z0-9_-]+)$ /index.php?go=$1&action=$2&do=$3&id=$4 

國防部重寫的事情是,當我做了搜索像https://www.server.com/search?search=try+search這樣做時,它不顯示任何結果:

echo $_GET['search']; 

但如果我這樣做https://www.server.com/?go=search&search=try+search然後它完美的作品,所以我看到的問題是重寫,但我不能修復它。

有什麼建議嗎?

感謝

+0

使用標誌'QSA' - > HTTP://的httpd。 apache.org/docs/current/rewrite/flags.html#flag_qsa – tttony 2014-09-03 00:09:12

+0

感謝您的評論,我該如何使用該標誌? – 2014-09-03 00:10:48

+0

看鏈接 - > http://httpd.apache.org/docs/current/rewrite/flags.html#flag_qsa – tttony 2014-09-03 00:11:16

回答

1

嘗試將此添加到每個規則:[QSA,L]

更多關於這裏的標誌:QSAL