Issue moving domain to new website
-
07-02-2021 - |
Frage
Magento 1.9.3.10
I thought I'd done everything correctly, but something isn't working.
All I want to do is move the domain I used on a staging Magento to a Live Magento.
I created the new Website/Store View and categories in the Live Magento, enabled it and disabled the Store View in the Staging Magento.
I removed the DNS I thought I'd put in to point the domain at the Staging Magento.
I then added the domain name into the System > Config > General > Web > Un/Secure fields in the Live Magento, did a full re-index and Cache dump.
I'm getting "The web page at ****** might be temporarily down or it may have moved permanently to a new web address."
What have I missed?
Lösung
You have to update the index.php
and .htaccess
index.php
You add the bellow code before Mage::run($mageRunCode, $mageRunType);
/*Websites redirects*/
switch($_SERVER['HTTP_HOST']) {
case 'yourdomaine1.com':
case 'www.yourdomaine1.com':
$mageRunCode = 'your_website_code_of_domaine1';
$mageRunType = 'website';
break;
case 'yourdomaine2.com':
case 'www.yourdomaine2.com':
$mageRunCode = 'your_website_code_of_domaine2';
$mageRunType = 'website';
break;
}
.htaccess
## SetEnv MAGE_RUN_TYPE store
SetEnvIf Host yourdomaine1\.com MAGE_RUN_CODE=your_website_code_of_domaine1
SetEnvIf Host www\.yourdomaine1\.com MAGE_RUN_CODE=your_website_code_of_domaine1
SetEnvIf Host yourdomaine2\.com MAGE_RUN_CODE=your_website_code_of_domaine2
SetEnvIf Host www\.yourdomaine2\.com MAGE_RUN_CODE=your_website_code_of_domaine2
Don't forget to set the base url for each website in admin website scope, clean the cache after.
Andere Tipps
After a lot of digging I finally got it up and running. I ended up using the following code in the .htaccess file
## SetEnv MAGE_RUN_TYPE store ##
SetEnvIf Host .*my_domain1.* MAGE_RUN_CODE=website_code_for_my_domain1
SetEnvIf Host .*my_domain1.* MAGE_RUN_TYPE=website