2013-11-01 109 views
1

我想重定向URL与查询字符串到另一个URL

http://www.mydomain.com/catalogsearch/result/index/?brand=1076&mode=grid&product_category=5533&q=pro+restore  

重定向以下URL此URL:

http://www.mydomain.com/nsearch/?q=pro+restore 

这是我用于htaccess的其他URL代码:

RewriteCond %{REQUEST_URI} ^/catalogsearch/result/index/$ 
RewriteCond %{QUERY_STRING} ^brand=1076&mode=grid&product_category=5533&q=pro+restore$ 
RewriteRule ^(.*)$ http://www.mydomain.com/nsearch/?q=pro+restore [R=301,L] 

但它不起作用。关于我失踪的任何想法?

感谢

回答

1

DOCUMENT_ROOT/.htaccess文件试试这个代码:

RewriteEngine On 

RewriteCond %{QUERY_STRING} ^brand=1076&mode=grid&product_category=5533&(q=pro\+restore)$ [NC] 
RewriteRule ^catalogsearch/result/index/?$ /nsearch/?%1 [R=301,L] 
+0

该诀窍,谢谢! – bones

+0

不客气,很高兴它为你解决。 – anubhava

相关问题