Welcome! Log In Create A New Profile

Advanced

Re: How to do location /test/place?id=2

P.V.Anthony
October 18, 2019 12:02AM
On 18/10/19 5:15 am, J. Lewis Muir wrote:

> You might want to use $arg_id here (i.e., the $arg_<name> variable for
> the <name> argument). Otherwise, it won't work if any other arguments
> are given.

Noted. I will change that.

>> Or is there a way to do the following? That would be ideal.
>>
>> location = /test/place?id=2 {
>> return 301 https://new.example.com/test/place?id=2
>> }
>
> I don't think that's allowed.

Yah. Sad.

>> Unfortunately the above does not work. What is missing?
>
> What doesn't work?

I was hoping to get location = /test/place?id=2 { to work. Like you have
mentioned, it is not allowed.

> I would think your
>
>> location = /test/place {
>
> block would work, although not as shown, but I assume you just left
> out the part that normally handles the request. It would handle the
> requests for id=1 and id=3 as before, and it's just the id=2 case that
> gets redirected, right?

That is where I need help with. I need help with requests for id=1 and
id=3. I need them to just pass through without any changes. I only need
id=2 to be redirected and id=2 redirection is working. I cannot figure
out how to pass through id=1 and id=3.

With the follow block id=1 and id=3 gives a 404 error.

location = /test/place {
if ($args = "id=2") {
return 301 https://new.example.com/test/place?$args;
}
}

How to make id=1 and id=3 to work?

P.V.Anthony

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

How to do location /test/place?id=2

P.V.Anthony October 17, 2019 01:02PM

Re: How to do location /test/place?id=2

J. Lewis Muir October 17, 2019 05:16PM

Re: How to do location /test/place?id=2

jeffdyke October 17, 2019 05:28PM

Re: How to do location /test/place?id=2

P.V.Anthony October 18, 2019 12:04AM

Re: How to do location /test/place?id=2

J. Lewis Muir October 18, 2019 09:48AM

Re: How to do location /test/place?id=2

P.V.Anthony October 19, 2019 01:56AM

Re: How to do location /test/place?id=2

P.V.Anthony October 18, 2019 12:02AM

Re: How to do location /test/place?id=2

Aleksandar Lazic October 19, 2019 04:24AM

Re: How to do location /test/place?id=2

P.V.Anthony October 20, 2019 01:18AM

Re: How to do location /test/place?id=2

Patrick October 17, 2019 09:04PM

Re: How to do location /test/place?id=2

P.V.Anthony October 18, 2019 12:14AM

Re: How to do location /test/place?id=2

Patrick October 18, 2019 12:20AM

Re: How to do location /test/place?id=2

P.V.Anthony October 18, 2019 01:18AM

Re: How to do location /test/place?id=2

Patrick October 18, 2019 01:36AM

Re: How to do location /test/place?id=2

P.V.Anthony October 18, 2019 01:58AM

Re: How to do location /test/place?id=2

Patrick October 18, 2019 03:00AM

Re: How to do location /test/place?id=2

P.V.Anthony October 19, 2019 01:56AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 79
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready