I am trying to create a multistore in Magento 2. The base url is something like http://example.com/business/. Now the multi store url needs to be like http://example.com/business/fr/.
I have followed everything like that mentioned in this: http://docs.magento.com/m2/2.1/ee/user_guide/stores/stores-all-create-store.html
Created store view and assigned url in web for that. But its giving 404 error whilst checking.
After digging on web, found that we need to modify index.php like below:
switch($_SERVER['HTTP_HOST']) {
case 'example.com/business':
$params[\Magento\Store\Model\StoreManager::PARAM_RUN_CODE] = 'default';
$params[\Magento\Store\Model\StoreManager::PARAM_RUN_TYPE] = 'store';
break;
case 'example.com/business/fr':
$params[\Magento\Store\Model\StoreManager::PARAM_RUN_CODE] = 'fr';
$params[\Magento\Store\Model\StoreManager::PARAM_RUN_TYPE] = 'store';
break;
}
$bootstrap = \Magento\Framework\App\Bootstrap::create(BP, $params);
/** @var \Magento\Framework\App\Http $app */
$app = $bootstrap->createApplication('Magento\Framework\App\Http');
$bootstrap->run($app);
Still i am getting 404. Can you just point me whats i am doing wrong here. Any kind of help will be much appreciated. Thanks in adv.