Cannot strip QS in rewrite

aquilinux aquilinux at gmail.com
Thu Jun 20 15:05:57 UTC 2019


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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.nginx.org/pipermail/nginx/attachments/20190620/6524da7b/attachment.html>


More information about the nginx mailing list