Remove query string on rewrite

celevra nginx-forum at
Thu Aug 12 10:32:56 MSD 2010

I am trying to make a 301 redirect like this: 
/authors.php?name=xxx  ==> /author/xxx

this config solves the problem partially - 

        location ~ ^/authors.php {
                 if ($args ~ "name=(.+)" ) {
                           set $arg_name $1;
                          rewrite ^/authors\.php "/author/$arg_name"

But the query string remains, and the final location is

How can i remove the unneeded query string? 

Thank you!

Posted at Nginx Forum:,118933,118933#msg-118933

More information about the nginx mailing list