我正在尝试重定向以下网址
http://www.mydomain.com/catalogsearch/result/index/?brand=1076&mode=grid&product_category=5533&q=pro+restore
到此网址:
http://www.mydomain.com/nsearch/?q=pro+restore
这是我用于htaccess中其他网址的代码:
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]
但它不起作用。关于我缺少的任何想法?
由于
答案 0 :(得分: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]