Welcome! Log In Create A New Profile

Advanced

Cannot strip QS in rewrite

aquilinux
June 20, 2019 11:08AM
Hi guys, i've always used ? to strip QS in rewrites but i cannot get past
this odd issue i'm having:

URL SOURCE:

> https://www.example.co.uk/ambassadors?test=1


REWRITE:

> rewrite (?i)^/ambassadors$
> https://www.example.com/uk-en/experience/ambassadors/? permanent;


OR EVEN:

> location ~* ^/ambassadors$ {
> rewrite (.*) https://www.example.com/uk-en/experience/ambassadors/?
> permanent;
> }


RESULT WITH REWRITE:

> [~]> curl -kIL https://www.example.co.uk/ambassadors?test=1
> HTTP/2 301
> date: Thu, 20 Jun 2019 14:44:21 GMT
> content-type: text/html
> location: https://www.example.com/uk-en/experience/ambassadors/?test=1
> x-who: SVAORMG2V01


RESULT WITHOUT REWRITE:

> [~]> curl -kIL https://www.example.co.uk/ambassadors?test=1
> HTTP/2 404
> date: Thu, 20 Jun 2019 14:55:45 GMT
> content-type: text/html


Am i missing something i cannot see?

Thanks for helping!


--
"Madness, like small fish, runs in hosts, in vast numbers of instances."

Nessuno mi pettina bene come il vento.
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

Cannot strip QS in rewrite

aquilinux June 20, 2019 11:08AM

Re: Cannot strip QS in rewrite

Maxim Dounin June 20, 2019 11:22AM

Re: Cannot strip QS in rewrite

aquilinux June 21, 2019 06:52AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

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