cancel
Showing results for 
Search instead for 
Did you mean: 

Multi language using subdirectory

Multi language using subdirectory

I want to achieve this by subdirectory: 

Domain | Store View Code
abc.com/en -> my_en abc.com/ms -> my_ms abc.com/zh -> my_zh abc.hk/en -> hk_en abc.hk/zh -> hk_zh


I have setup my nginx map to read it works as intended but I'm receiving 404 error when trying to access the site.

Here is my nginx setup:

map $request_uri $MAGE_RUN_CODE {
default my_en;
~^/zh my_zh;
~^/ms my_ms;
}

map $request_uri $MAGE_RUN_TYPE {
default store;
~^/zh store;
~^/ms store;
}

upstream fastcgi_backend {
server unix:/run/php/php7.0-fpm.sock;
}

server {
listen 80;
server_name abc.com;
set $MAGE_ROOT /var/www/html;
include /var/www/html/nginx.conf.sample;
}


The store changed successfully, but it is showing me 404 error. Any idea on how to resolve this issue?

1 REPLY 1

Re: Multi language using subdirectory

Could someone help please I'd like achieve the same concept