Thursday, June 21, 2012

Apache url rewrite reference

 1.  Goal: Take /category/categoryname?page=# and rewrite into /categorydetail.php?catname=name&page=#

RewriteRule ^category/(.*) categorydetail.php?catname=$1 [QSA,L]

Why? [QSA] will keep the original query string, which in this case is page=#, and append catname=$1


http://www.simonecarletti.com/blog/2009/01/apache-rewriterule-and-query-string/

No comments:

Post a Comment

There was an error in this gadget