I tried these steps, but nothing happened. I got 500 internal server error https://www.cloudways.com/blog/create-and-configure-multistore-magento-2/
I have 3 domains.
The main is beste.nl
. The others are fejie.nl
and pacats.nl
.
Codes:
beste.nl = beste
fejie.nl = fejie
pacats.nl = pacats
I just copied the index.php
of beste.nl
and pasted into fejie.nl
, and using this following code:
$params = $_SERVER;
$params[\Magento\Store\Model\StoreManager::PARAM_RUN_CODE] = 'fejie';
$params[\Magento\Store\Model\StoreManager::PARAM_RUN_TYPE] = 'website';
$bootstrap = \Magento\Framework\App\Bootstrap::create(BP, $params);
$app = $bootstrap->createApplication('Magento\Framework\App\Http');
$bootstrap->run($app)
I just copied the .htaccess
of beste.nl
and pasted into fejie.nl
, and using this following code:
RewriteCond %{HTTP_HOST} ^(.)fejie.nl
RewriteRule . – [E=MAGE_RUN_CODE:fejie]
RewriteCond %{HTTP_HOST} ^(.)fejie.nl
RewriteRule . – [E=MAGE_RUN_TYPE:website