htaccess - 301重定向

时间:2014-04-24 00:08:43

标签: .htaccess redirect

我想重定向

 http://www.mysite.com/index.php?channels=browse&channel_id=1&sort=rated 

 http://www.mysite.com/category/cars/?r_sortby=highest_rated&r_orderby=desc

有人可以帮我解决这个问题吗?

谢谢!

1 个答案:

答案 0 :(得分:1)

这应该对你有用

RewriteEngine on
RewriteCond %{THE_REQUEST} ^(GET|POST)\ /index\.php\?channels=browse&channel_id=1&sort=rated\ HTTP
RewriteRule ^ /category/cars/?r_sortby=highest_rated&r_orderby=desc? [R=301,L]

编辑:

RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteCond %{REQUEST_URI} !^/category/(.*)
RewriteRule ^(.*)$ /watch.php?tag=$1 [L]