htaccess使用关键字重定向搜索查询字符串



我很难用手写单词(非动态)进行搜索重定向,但从来没有用过相同的单词

我需要重定向这个:

http://www.example.com/search/results.html?search_in_description=1&keyword=rabbit

对此:

http://www.example.com/recherche?orderby=position&controller=search&orderway=desc&search_query=rabbit

知道"兔子"只是一个例子,可以是任何单词。

尝试:

RewriteEngine On
RewriteCond %{QUERY_STRING} ^search_in_description=1&keyword=([^&]+)
RewriteRule ^search/results.html$ /recherche?orderby=position&controller=search&orderway=desc&search_query=%1 [L,R=301,NE]

最新更新