Subscribe RSS
Rewriting the Query String Apr 21

Sometimes you want to redirect the user to a new page based on a specific query string value. Heres  how to do that:


RewriteCond %{QUERY_STRING} foo=bar&bim=bam
RewriteRule ^horrible.php$ /farbetter.html? [R=302]

This redirects all traffic going to “horrible.php?foo=bar&bim=bam” to goto “farbetter.html”. Note that for all other querystring vars horrible.php is still available.

Category: Apache  | Tags: , , ,
You can follow any responses to this entry through the RSS 2.0 feed. You can skip to the end and leave a response. Pinging is currently not allowed.
Leave a Reply