使用htaccess将301 dynamic-URL重定向到404错误页面?

时间:2014-01-24 16:36:16

标签: .htaccess redirect http-status-code-404 dynamic-url

有人可以帮助我获得正确的.htaccess规则:

重定向此特定ID网址:

http://www.domain.com/watch.php?id=00000000001

到我的404错误页面:

http://www.domain.com/404/

1 个答案:

答案 0 :(得分:0)

DOCUMENT_ROOT/.htaccess文件中使用此规则:

RewriteEngine On

RewriteCond %{QUERY_STRING} ^id=00000000001$ [NC]
RewriteRule ^watch\.php$ /404/? [NC,L,R=301]