I have this url:
https://example.com/admin/catalog/product/view/id/45533/?___store=en_us&sendAttributionID=email_automation_5ffa6c5967af4527508858fb&ContactID=5f9d9eac1215fsdfsdfasdffsdfsdf04ff6c98af
I need to redirect it with nginx to:
https://example.com/catalog/product/view/id/45533/?___store=el_gr&sendAttributionID=email_automation_5ffa6c5967af4527508858fb&ContactID=5f9d9eac1215fsdfsdfasdffsdfsdf04ff6c98af
In fact I need from first link: To remove
admin
and replace:
en_us
with:
el_gr
I have this regex for now:
rewrite ^/admin/(.*)$ https://example.com/$1 permanent;
which removes the admin word. But I can't figure out how to replace the
en_us
After UML help now I am in:
rewrite ^/admin/(.*?)en_us(.*?)$ https://example.com/$1el_gr$2 permanent;
which in Online Regex works but not in nginx
Any help please?
EDITED
I first thought that just changing the regex would help, like this:
However, as the rewrite matching only works on the "filename" part (up to ?), it won't work. Some other technique is required.