Question

Can someone help me to get the correct .htaccess rules for:

Redirect this specific ID url:

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

to my 404 error page:

http://www.domain.com/404/
Was it helpful?

Solution

Use this rule in your DOCUMENT_ROOT/.htaccess file:

RewriteEngine On

RewriteCond %{QUERY_STRING} ^id=00000000001$ [NC]
RewriteRule ^watch\.php$ /404/? [NC,L,R=301]
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top