Following documentation in admin panel I've added second website. On each website (default and new) I have exactly one unique store and for each store I have exactly one unique view. Like below

website_1 -> store_1 -> view_1

website_2 -> store_2 -> view_2

In apache configuration files, under virtualhost I've added

  SetEnv MAGE_RUN_CODE "website_1"
  SetEnv MAGE_RUN_TYPE "website"


  SetEnv MAGE_RUN_CODE "website_2"
  SetEnv MAGE_RUN_TYPE "website"

for each domain respectively.

There is optional step in documentation: "Add the store code to the base URL". Which I left default - No

Everything seems to run properly for now.

In documentation there is an option: "Add the store code to the base URL" with following warning:

Magento gives you the option to add the store code to the site base URL, which simplifies the process of setting up multiple stores. Using this option, you do not have to create directories on the Magento file system to store index.php and .htaccess.

This prevents index.php and .htaccess from getting out of sync with the Magento codebase in future upgrades.

The question is, if (with my described configuration) I can safely left "Add the store code to the base URL" option set to NO or it's going to cause errors in future.

1 Answer 1


since you have different domains set up and also seem to have configured everything correctly in the .htaccess(which I would consider best practice for a multi website setup) you do not need to set it to yes.

it's correct that the .htaccess will then be out of sync, but since it does not change very often, you just have to check once in a while when u update your magento if it has important changes you need (if you are using the /pub directory as document root, this is even more unproblematic since sensitive directories are already secure by design).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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