Monday, February 16, 2009

Apache's mod_rewrite on a specific URL parameter

The trick is to match the parameter on the QUERY_STRING variable, like this:


RewriteCond %{QUERY_STRING} ^param1=value1$
RewriteRule ^/some_script.php(.*) http://www.someotherlocation.com/another_script.php$1 [R=301,L]

0 comments: