Hi guys,
I need to advice with following:
I have two domains .cz and .com. I set up these two domains in my admin https://snipboard.io/5GESou.jpg
Now .com is still redirect to .cz , but the redirection is not activated.
.com is a parked domain .cz and share a same document root (screen attached). I don't know what to do and I need to domain work correctly:
1) .cz - works now fine
2) .com - has two store views
a) EN - Which is default for english speaker (any slash .com/en is not necessary)
b) DE - I want it to be .com/de
Magento 2.4.2-p1
Thank you for your help.
V.
Hi there,
I had the very same problem with MAGENTO 2.1 . After reading thousands (literally) of blogs, tutorials and websites I figured it out by sticking a few lines of code.
1 : Do not touch the .HTACCESS file. There's nothing to modify in there.
2 : Open INDEX.PHP and replace the following code
$bootstrap = \Magento \Framework\App\Bootstrap::create(BP, $_SERVER); /** @var \Magento\Framework\App\Http $app */ $app = $bootstrap->createApplication('Magento\Framework\App\Http'); $bootstrap->run($app);
by this code :
$params = $_SERVER; switch($_SERVER['HTTP_HOST']) { case 'Domain1.com': case 'www.Domain1.com': $params[\Magento\Store\Model\StoreManager::PARAM_RUN_CODE] = 'Website_code1'; $params[\Magento\Store\Model\StoreManager::PARAM_RUN_TYPE] = 'website'; break; case 'Domain2.com': case 'www.Domain2.com': $params[\Magento\Store\Model\StoreManager::PARAM_RUN_CODE] = 'Website_code2'; $params[\Magento\Store\Model\StoreManager::PARAM_RUN_TYPE] = 'website'; 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);
There's 4 things to replace in the above code.
Hi there,
I had the very same problem with MAGENTO 2. . After reading thousands (literally) of blogs, tutorials and websites I figured it out by sticking a few lines of code.
1 : Do not touch the .HTACCESS file. There's nothing to modify in there.
2 : Open INDEX.PHP and replace the following code
$bootstrap = \Magento\Framework\App\Bootstrap::create(BP, $_SERVER); /** @var \Magento\Framework\App\Http $app */ $app = $bootstrap->createApplication('Magento\Framework\App\Http'); $bootstrap->run($app);
by this code :
$params = $_SERVER; switch($_SERVER['HTTP_HOST']) { case 'Domain1.com': case 'www.Domain1.com': $params[\Magento\Store\Model\StoreManager::PARAM_RUN_CODE] = 'Website_code1'; $params[\Magento\Store\Model\StoreManager::PARAM_RUN_TYPE] = 'website'; break; case 'Domain2.com': case 'www.Domain2.com': $params[\Magento\Store\Model\StoreManager::PARAM_RUN_CODE] = 'Website_code2'; $params[\Magento\Store\Model\StoreManager::PARAM_RUN_TYPE] = 'website'; 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);
There's 4 things to replace in the above code.
Read more here!
Hi,
thank you, but how should I write the URLs address
case 'Domain1.com': case 'www.Domain1.com':
In my case
case 'Kouzloloutek.cz' :
case 'www.kouzloloutek.cz ' :
Is it correct, please?
Hi,
thank you, but how should I write the URLs address
case 'Domain1.com': case 'www.Domain1.com':
In my case
case 'Kouzloloutek.cz' :
case 'www.kouzloloutek.cz' :
Is it correct, please?