URL重写删除“&”拥有干净的搜索网址

时间:2014-11-20 19:14:01

标签: .htaccess mod-rewrite

我已经用Google搜索了所有查询字符串,无法找到解决方案:

我想要这个网址: http://domain.com/?s=keyword&geo-radius=100&geo-lat=0&geo-lng=0&categories=0&locations=0&dir-search=yes

成为这一个: http://domain.com/?s=keyword

删除所有内容,包括&

感谢您的帮助,非常感谢。

1 个答案:

答案 0 :(得分:0)

尝试:

RewriteEngine On
RwriteCond %{QUERY_STRING} ^(s=[^&]*)&.+
RewriteRule ^$ /?%1 [L,R]
相关问题