View Single Post
Old 01-15-2008, 02:15 PM   #6 (permalink)
Salathe
Moderateur
RegEx Guru PHP Guru Top Contributor Advanced Programmer 
 
Salathe's Avatar
 
Join Date: Apr 2007
Posts: 1,393
Thanks: 5
Salathe is on a distinguished road
Default

Just a technical note, the QSA flag appends any query string to the end of the rewritten request in the same way that Mubs' code does. However, a little tweak in the placement of the %{QUERY_STRNG} variable might be of use (or just a fanciful idea).

Consider the following url after rewriting: index.php?section=news&action=recent&<QS> (<QS> is just a placeholder to save space). If the requested url was: /news/recent.html?section=auctions then that request would be rewritten to: index.php?section=news&action=recent&section=aucti ons (sorry vbulletin inserts a space unnecessarily) which would call the recent action within the auctions section, not news!

The tweak to Mubs' rule would be to move the placement of the query string variable:
index.php?%{QUERY_STRING}&section=$1&action=$2

This means that even if section and/or action are passed through the query string manually, the "path" versions will always be used. All that said, it's a minor point and you may choose to simply use the QSA flag and accept the 'false' values in the query string.
Salathe is offline  
Reply With Quote