1

当我输入这个网址时:

http://www.mydomain/search.php?page=1&order=ASC&contract=rent&new=

url 应该重定向到

http://www.mydomain/rent/1

我尝试在我的 .htaccess 中添加这一行,但没有成功:

Redirect http://www.mydomain/search.php?page=1&order=ASC&contract=rent&new= http://www.mydomain/rent/1

提前致谢!!!

4

1 回答 1

1

改为添加这些行(但如果第一行还没有,您只需要添加第一行):

RewriteEngine On
RewriteCond %{QUERY_STRING} ^page=(\d+)&order=ASC&contract=rent&new=$
RewriteRule search.php /rent/%1? [L,R=301]
于 2013-10-07T22:29:00.767 回答