2013-08-29 98 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] 
相关问题