How do I rewrite URIs of the form
/one/two?path=three&foo=bar
to
/one/two/three?foo=bar
using nginx?
How do I rewrite URIs of the form
/one/two?path=three&foo=bar
to
/one/two/three?foo=bar
using nginx?
Try this:
location ~ /one/two {
if ($args ~ "path=([^&]+)&(.+)") {
set $path $1;
set $foo $2;
rewrite ^/one/two "/one/two/$path?$foo?" permanent;
}
}