Welcome! Log In Create A New Profile

Advanced

Re: Nginx redirect quey string to url

Richard Stanway
June 29, 2017 07:24PM
rewrite and location matching do not include query strings. As a quick
workaround, I believe you could do something like this:

if ($request_uri = "/abc/xyz/def.php?Id=13") { return 301 "
http://www.example.com/fhu/foo"; }

Be aware that this matches the request exactly - query string parameters
must be in the same order and case.

On Thu, Jun 29, 2017 at 9:20 PM, AjaySawant <nginx-forum@forum.nginx.org>
wrote:

> I am trying to redirect a query string to url and I am using like this but
> it is somehow not working. Can somebody help?
>
> rewrite ^/abc/xyz/def.php?Id=13 http://www.example.com/fhu/foo permanent;
> rewrite ^/abc/xyz/def.php?Id=14 http://www.example.com/fhu/bar permanent;
>
> Posted at Nginx Forum: https://forum.nginx.org/read.
> php?2,275218,275218#msg-275218
>
> _______________________________________________
> nginx mailing list
> nginx@nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx
>
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

Nginx redirect quey string to url

AjaySawant June 29, 2017 03:20PM

Re: Nginx redirect quey string to url

Richard Stanway June 29, 2017 07:24PM

Re: Nginx redirect quey string to url

AjaySawant June 29, 2017 07:54PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 210
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