301使用参数重定向URL

时间:2014-04-22 23:45:29

标签: .htaccess redirect http-status-code-301 url-redirection

我使用此代码并且工作正常:

RewriteEngine on

RewriteCond %{QUERY_STRING} category
RewriteRule ^index\.php$ /categories/? [L,R=301]

RewriteCond %{QUERY_STRING} channels
RewriteRule ^index\.php$ /channels/? [L,R=301]

但如果我添加以下代码,则第一个代码不再有效:

RewriteCond %{THE_REQUEST} ^(GET|POST)\ /watch\.php\?tag=(.*)\ HTTP
RewriteRule ^ /%2? [R=301,L]

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

我哪里错了?

0 个答案:

没有答案