As usual, my fault ;) The problem was the "rule order". if (!-e $request_filename) { rewrite ^(.*)$ /index.php last; break; } rewrite "^/({2})/?$" /index.php?country=$1 last; The first rule stopped the second one from working.by devin - Nginx Mailing List - English
I already tried this one. I'm using quotes due to the brackets {}, if I don't use them, nginx fails to read the config, as {} are used by nginx config. I have: location / { some-non-rewrite-rules-only-basic-config-rules if (!-e $request_filename) { go to index.php } rewrite ^/()/?$ /index.php?country=$1 break; } And it still doenst works. Thnx for your help.by devin - Nginx Mailing List - English
I have tried tons of combinations without any luck: I want to get this rule: http://www.domain.com/uk/ -> index.php?country=uk From Apache: RewriteRule ^({2,}/)$ index.php?country=$1 RewriteRule ^({2,})$ index.php?country=$1 RewriteRule ^({2}/)index.php$ index.php?country=$1 I tried in location /: rewrite "^({2}/)$" index.php?country=$1 break;by devin - Nginx Mailing List - English