Hi All,
What is the best way to configure website(domain.com/) on mobile with prefix “m” i.e m.domain.com/ and there are some changes in mobile templates, that is when site opens on desktop the domain should be domain.com/ but when we opens on mobile the domain must be m.domain.com/ with different design
of PDP and PLP templates
In addition also to configure the multi-language with multi-currency.
1: Make a pointer domain with same shared directory
2: In index.php
$params = $_SERVER;
$customstore = array( ‘m.mobiledomain.co’=>‘mobilestoreview’// storeviewcode ); if(isset($customstore[$_SERVER[‘HTTP_HOST’]])){ $code = $customstore[$_SERVER[‘HTTP_HOST’]]; }
$params[\Magento\Store\Model\StoreManager::PARAM_RUN_CODE] = isset($code) ? $code : ‘’; $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);
reindex, clear cache, run in another browser