On the magento 2.1.5 website i add new store view, and i have:



i need remove "default" from url, for get this



If i set "Add Store Code to Urls" to NO, website.com/uk doesn't working

Please help me with this issue. Thank


This answer can also be found in the Experius Codeblog


You could run the second store in a subdirectory and depending on your server (NGINX or apache) how you can configure this.

Follow the following instructions:

Disable Store Code in URL

This Configuration setting has to be disabled to be able to use subdirectories.

Stores > Settings > Configuration > General > Web > Url Options > Add Store Code to URLS

Configure Base URL

Foreach Base URL you have to add the subfolder at the end

For example

Global: http://example.com/

Dutch storeview: http://example.com/nl/

French storeview: http://example.com/fr/

Create Subfolders

Create a Subfolder foreach different storeview, for which you configured the new base url, in the pub folder. This is because all request for each stroeview ill go through this folder.


mkdir ~/[pathToMagentoRoot]/pub/nl

mkdir ~/[pathToMagentoRoot]/pub/fr

Create Symlinks in the subfolder to the media, static, opt and errors folders. This is necessary to correctly load the media and theme files.

For example:

cd ~/[pathToMagentoRoot]/pub/fr ln -s ../media media

ln -s ../static static

ln -s ../opt opt

ln -s ../errors errors

Copy the index.php and .htaccess

Now you only have to copy the index.php and .htaccess from the pub folder and edit these according to the entry points.

For example:

In the index.php change the following sentence:

require realpath(DIR) . '/../app/bootstrap.php';


require realpath(DIR) . '/../../app/bootstrap.php';

Then edit .htaccess (only when you are running on an apache server). In this example there is only an explanation for nginx.

Nginx rewrite foreach Storeview Add the following block to your nginx configuration foreach storeview:

location /[storeviewfolder]/ {

index index.php index.html index.htm;

try_files $uri $uri/



Disable Store Code URL

Disable Store Code

Stores > Settings > Configuration > General > Web > Url Options > Add Store Code to URLS
  1. Uncheck Use system value
  2. On Drop-down menu, click > No

On my case under Search Engine Optimization

  1. Uncheck Use system value
  2. Use Web Server Rewrites > Yes

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.