How can I redirect all URL that contain value=123
and something
to /maintenance.php
?
Redirect e.g.:
www.example.com/something/myfile.php?value=123
www.example.com/something/thisfile.php?value=123
Don't redirect e.g.
www.example.com/something/myfile.php?value=999
www.example.com/something/myfile.php?test=999
www.example.com/folder/myfile.php?value=123
How can I do this with .htacces
?
You can use this redirect rule to match a specific URI with a specific QUERY_STRING
:
RewriteEngine On
RewriteCond %{THE_REQUEST} \s/+something/[^?]*\?value=123[&\s] [NC]
RewriteRule ^ /maintenance.php? [R=302,L]