Php 带有关键字的htaccess重定向搜索查询字符串

Php 带有关键字的htaccess重定向搜索查询字符串,php,string,.htaccess,search,redirect,Php,String,.htaccess,Search,Redirect,我正在努力与搜索重定向手写字不是动态的,但从来没有相同的字 我需要重定向这个: 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 认识兔子

我正在努力与搜索重定向手写字不是动态的,但从来没有相同的字

我需要重定向这个:

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]

您应该提到您使用的HTTP服务器来获得正确答案@wirefram认识兔子只是一个例子,可以是任何单词。这就是为什么它被称为动态。