Dealing with Apache's limit on back-references when rewriting URLs
For the ones of you who didn’t know (I didn’t know either), Apache has a limit on the number of back references you can use when rewriting a URL.
For the people who don’t know I will explain what is a back reference when talking about apache rewrites.
When you do a rewrite of a URL using apache mod_rewrite you translate a URL into an actual resource that apache can find.
For my examples I will use the domain http://ncona.com. If I wanted that the URL http://ncona.com/file loaded the file other_file.html located in my web root I would use a rule like this one:
1
RewriteRule ^file$ /other_file.php
That is a static rewrite but you can also use back reference to make dynamic URLs:
1
RewriteRule ^product/([0-9]+)$ /product_details.php?id=$1