In Magento 2 I try to add specific base url for store view.
This is my configuration :
My website 1 contains two store view :
- Store view 1 : my_store_view_1
- Store view 2 : my_store_view_2
Base urls secure unsecure are configured like this :
- my_store_view_1 : mydomain.com/fr/
- my_store_view_2 : mydomain.com/nl/
I have created two subfolders in magento root :
- <magento_root>/fr/
- <magento_root>/nl/
Each folder contains copy of root .htacces and index.php with :
<?php
require realpath(__DIR__) . '/../app/bootstrap.php';
$params = $_SERVER;
$params[\Magento\Store\Model\StoreManager::PARAM_RUN_CODE] = 'my_store_view_1';
$params[\Magento\Store\Model\StoreManager::PARAM_RUN_TYPE] = 'store';
$bootstrap = \Magento\Framework\App\Bootstrap::create(BP, $params);
$app = $bootstrap->createApplication('Magento\Framework\App\Http');
$bootstrap->run($app);
When I visit "mydomain.com" I 'm successfully redirected to "mydomain.com/fr/" but only homepage is working, other pages are 404 not found.
When I visit "mydomain.com/nl/" I'm redirected automatically to "mydomain.com/fr/"
Do you know what is missing in my configuration ? Thanks