如何在.htaccess中重定向?

时间:2014-05-15 08:26:04

标签: .htaccess

us / my-blog?catid = 1& id = 404:my-thought-of-the-day-problem-of-traditional-education

RewriteRule ^\/?us/my-blog\?catid=\d+id=\d+\:(.*) http://www.takeshiyashima.com/us/my-blog/others/404-my-thought-of-the-day-problem-of-traditional-education/$1 [R=301,L]  

我试过这个规则。但这不起作用。我有很多像这样的网址。我想重定向他们。该怎么办。

1 个答案:

答案 0 :(得分:0)

这应该有效:

RewriteEngine On

RewriteCond %{THE_REQUEST} ^(GET|POST)\ /us/my-blog\?catid=1&id=(.*)\:(.*)\ HTTP
RewriteRule ^ /us/my-blog/others/%3-%4? [R=301,L]