I'm trying to implement multiple website in Magento 2.1.3 For that, I have created an extra website store and store view
My site URL is like www.example.com
My subdomain is www.kw.example.com(where kw is the code of new website).
I have create sub domain in my domain and point this in to a new folder in Magento root folder which contain the index file of new website.
And i have changed the website URL and secure BASE URL as www.kw.example.com
but when i try to access to this URL its redirecting in to www.example.com
Best Answer
Follow this and comment for any issue:
Attention: Change newstore to the code that you wrote down when you created the new website above.
Replace:
With:
require __DIR__ . '/app/bootstrap.php'; $params = $_SERVER; $params[\Magento\Store\Model\StoreManager::PARAM_RUN_CODE] = 'newstore'; $params[\Magento\Store\Model\StoreManager::PARAM_RUN_TYPE] = 'website'; $bootstrap = \Magento\Framework\App\Bootstrap::create(BP, $params); /** @var \Magento\Framework\App\Http $app */ $app = $bootstrap->createApplication('Magento\Framework\App\Http'); $bootstrap->run($app);
ln -s /home/example/example.com/html/app/ app
ln -s /home/example/example.com/html/lib/ lib
ln -s /home/example/example.com/html/pub/ pub
ln -s /home/example/example.com/html/var/ var
Update in Your case:
Replace
ln -s /home/example/example.com/html/app/ app
withln -s /var/www/html/m2/example.com/app/ app