Get in touch:
01524 851 877
07718 896 553

Apache Mod Rewrite And HTTP GET

Posted on May 20 2009 by Matthew Jakeman

Just a quick post about passing the HTTP GET parameters to pages when using Apache with Mod Rewrite. Obviously if you are using a rule that redirects a number of URL’s to a single script and you try to pass GET parameters they just get tagged on to the end of it which will usually break things. You need to append the GET parameters from within the rewrite rule as shown below to get it to work properly.

RewriteRule ^(.*)/$ index.php?page=$1&%{QUERY_STRING}
Simply appending ‘&%{QUERY_STRING}’ to the end of the rule tells Mod Rewrite to append the GET parameters.

Leave a comment