Nginx Vhost Config - Get page based on translated URI and without parameters in url I have a localized site, localization works fine for homepage (/en/), however the links to other page does not work (/en/rooms) where /chambres works fine for default language.

The English 'chambres' page is accessible with /en/?p=rooms

I would like the english page being accessible with /en/rooms

It's definitely an Nginx vhost config issue. The config listed in Locales sub directories on Nginx didn't solve my problem.

This is my english index.php:

// Tell Craft to serve the English content
define('CRAFT_LOCALE', 'en');


This is in my general config file:

'quartiergeneral.craft.dev' =&gt; array(
        'devMode' =&gt; true,
        'usePathInfo' =&gt; true,
        'omitScriptNameInUrls' =&gt; true,
        'environmentVariables' =&gt; array(
            'basePath' =&gt; '/home/vagrant/Code/quartiergeneral/craft/public/',
            'baseUrl'  =&gt; 'http://quartiergeneral.craft.dev:8000/',
        ),
        'siteUrl' =&gt; array(
            'fr' =&gt; 'http://quartiergeneral.craft.dev:8000/',
            'nl' =&gt; 'http://quartiergeneral.craft.dev:8000/nl/',
            'en' =&gt; 'http://quartiergeneral.craft.dev:8000/en/',
        ),
    ),


This is my nginx config vhost:

server {
    listen 80;
    server_name quartiergeneral.craft.dev;
    root /home/vagrant/Code/quartiergeneral/craft/public;

    index index.html index.htm index.php;

    charset utf-8;

    location / {
        try_files $uri $uri/ @rewrites;
    }

    location @rewrites {
        rewrite ^(.*) /index.php?p=$1 last;
    }

    location = /favicon.ico { access_log off; log_not_found off; }
    location = /robots.txt  { access_log off; log_not_found off; }

    access_log off;
    error_log  /var/log/nginx/quartiergeneral.craft.dev-error.log error;

    error_page 404 /index.php;

    sendfile off;

    location ~ \.php$ {
        fastcgi_split_path_info ^(.+\.php)(/.+)$;
        fastcgi_pass unix:/var/run/php5-fpm.sock;
        fastcgi_index index.php;
        include fastcgi_params;
    }

    location ~ /\.ht {
        deny all;
    }
}
Ok, I got it working with:

nginx vhost config:

location /en/ {
    try_files $uri $uri/ @enrewrites;
}

location /nl/ {
    try_files $uri $uri/ @nlrewrites;
}

location / {
    try_files $uri $uri/ @rewrites;
}

location @enrewrites {
    rewrite ^/en/(.*)$ /en/index.php?p=$1 last;
}

location @nlrewrites {
    rewrite ^/nl/(.*)$ /nl/index.php?p=$1 last;
}

location @rewrites {
    rewrite ^(.*) /index.php?p=$1 last;
}


And in general craft config:

'omitScriptNameInUrls' =&gt; true,