Welcome! Log In Create A New Profile

Advanced

Remove query string on rewrite

August 12, 2010 02:32AM
Hi,
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" permanent;
}
}

But the query string remains, and the final location is /author/xxx?name=xxx

How can i remove the unneeded query string?

Thank you!
Subject Author Posted

Remove query string on rewrite

celevra August 12, 2010 02:32AM

Re: Remove query string on rewrite

Mikhail Mazursky August 12, 2010 06:02AM

Re: Remove query string on rewrite

Maxim Dounin August 12, 2010 06:08AM

Re: Remove query string on rewrite

tyanhly February 07, 2012 08:44PM

Re: Remove query string on rewrite

tyanhly February 07, 2012 08:54PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 290
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready