I would to make a Regex (I use Nginx) to have something like this :
Example of output :
/m/signup
/en/signup
/fr/m/signup
/en/m/signup
I tried something like this :
rewrite ^/(m|(fr|en)|(fr|en)\/m)/(signup|otherpage)$ /$2.php?p=$1 last;
the parameter "p" should be either "m", or "en", or "fr", or "fr/m" for example.
but it doesn't want to work..
Any idea ?
^/((?:fr|en|m)(?:/(?:fr|en|m))?)/(signup)$? It will also match/fr/fr/signupor/m/m/signupthough - is it OK? Also, try^/((?:en|fr)/m|m|(?:en|fr))/(signup)$. Or is the problem in capturing the language abbreviation?