2013-08-29 96 views
0

下面是我的配件頁面URLhtaccess的重寫規則的查詢字符串

http://localhost/motobatt/index.php?route=information/static&p=62&b=59 

,而這個頁面已經可以訪問使用這個網址

http://localhost/motobatt/accessories 

但現在如何通過這些查詢,網址應該是這樣的

http://localhost/motobatt/accessories&p=62&b=59 

我的.htaccess

RewriteBase /motobatt 
RewriteRule ^accessories index.php?route=information/static&p=$1&b=$2 
+1

查詢字符串始於一個問號,而不是一個符號。 – CBroe

回答

1

從您的規則中刪除&p=$1&b=$2位。 $1$2沒有任何捕獲組來回引用,因此它們最終會變成空白。你想要的是使用QSA標誌,該標誌將任何現有的查詢字符串添加到您的規則的目標的結尾:

RewriteBase /motobatt 
RewriteRule ^accessories index.php?route=information/static [QSA] 
相關問題