DEV Community πŸ‘©β€πŸ’»πŸ‘¨β€πŸ’»

DEV Community πŸ‘©β€πŸ’»πŸ‘¨β€πŸ’» is a community of 964,423 amazing developers

We're a place where coders share, stay up-to-date and grow their careers.

Create account Log in
Rafael CorrΓͺa Gomes
Rafael CorrΓͺa Gomes

Posted on • Originally published at rafaelstz.github.io

Configure a local Magento 2 multi-store

When we have to configure a multi-store in your local machine you can configure the local NGINX or Apache configuration to make it work, or you can quickly change your index.php just to test, fix the issues and not commit this change.

In this same case just to test using Magento 1 we used to change the $mageRunCode and $mageRunType in the .htaccess or httpd.conf.
In Magento 2 to test quickly you can use that code into your index.php:

$params = $_SERVER;
$params[\Magento\Store\Model\StoreManager::PARAM_RUN_CODE] = 'website_code';
$params[\Magento\Store\Model\StoreManager::PARAM_RUN_TYPE] = 'website';
$bootstrap = \Magento\Framework\App\Bootstrap::create(BP, $params);
Enter fullscreen mode Exit fullscreen mode

Top comments (0)

Take a look at this:

Settings

Go to your customization settings to nudge your home feed to show content more relevant to your developer experience level. πŸ›