Hi,
Our site has urls such as
/mexico/MX_en/
/mexico/MX_es/projects/
/brasil/BR_pt/account/
The home page is at "multiple" locations per country
/
and e.g.
/mexico/MX_en/
These pages show the same content.
For first time users who arrive at these page, we have an introductory page.
After you register, we don't want people to arrive at these pages anymore, so we write a cookie and let nginx redirect to a different page when the cookie is there. So far so good.
The problem is rewriting pages with the url
/mexico/MX_en/
Because these urls are not fixed, we want to match these with a regular expression such as below.
However, this also matches urls based on the same base including the redirect url itself
/mexico/MX_en/search/
/mexico/MX_en/account/
#this works fine
location = / {
if ($ctry !~ 0){
rewrite ^(.*)$ http://$host/$ctry$lng/search/;
}
try_files $uri @proxy;
}
#this does not
location ~ /[^/]+/.._../ {
if ($ctry !~ 0){
rewrite ^(.*)$ http://$host$uri/search/;
}
try_files $uri @proxy;
}
Can anybody point me the way to be able to have an exact match on a url that uses a regular expression?
Kind regards,
Marc