I\'ve been reading through a previous solution to a recursive mod_rewrite problem that is similar to what I\'m trying to do, the difference is I\'m sending all queries throu
I copied the solution from that other question and modified it like this:
RewriteCond %{QUERY_STRING} ^(.*)$
RewriteRule ^(.*/)?([^/]+)/([^/]+) $1?$2=$3&%1 [L]
RewriteCond %{QUERY_STRING} ^(.*)$
RewriteRule ^.*$ index.php?%1 [L]
It does nearly the same thing, except in the first rule, the first match is optional and in the second rule, the match is on whatever is left after all the other pairs are matched.
For an odd number of parameters, the first parameter is ignored.
One note, if you expect to have a lot of parameters, you may have to change some settings.
Add something like this to your .htaccess file
RewriteOptions MaxRedirects=20
and something like this to your apache conf file
LimitInternalRecursion 20
Instead of "20" pick whatever number of recursions (pairs) you need to allow (the default is 10).