Is there any way to capture multiple parameters from a querystring for a
rewrite?
For example:
The request is: /myscript.php?a=b&c=d&z=y
The target is: /script/a/b/c/d/z/y
So, the basic rewrite would be:
location /myscript.php {
if( $args ~* ^a=([^\&]+)&b=([^\&]+)&z=([^\&]+)$ ){
rewrite ^ /script/a/$1/b/$2/z/$3 permanent;
}
}
However, how would I cope with situations where the args aren't in the
order of a/b/z? Obviously if I have 10 args I don't want to have to do
an "if" for each permutation, that could get both confusing and lengthy!