Skip to content

Instantly share code, notes, and snippets.

@sashas777
Created July 19, 2018 23:51
Show Gist options
  • Save sashas777/ee1d771f7c5c9c0d8477bb232a1c54da to your computer and use it in GitHub Desktop.
Save sashas777/ee1d771f7c5c9c0d8477bb232a1c54da to your computer and use it in GitHub Desktop.
Magento 2 Cloud Multistore where store set by url /{{store_code}}
Two steps:
1. Setup Multistore at the admin where each store url are the same
2. Create pub/{{store_code}}/index.php
<?php
require realpath(__DIR__) . '/../../app/bootstrap.php';
$params = $_SERVER;
$params[\Magento\Store\Model\StoreManager::PARAM_RUN_CODE] = '{{store_code}}';
$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);
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment