We have added multiple websites in different domains but it does not redirect the website, all required setting are enabled.
2 Answers
You may have skipped or missed a step.
Please check below steps:
- Create root categories for different websites. (Not mandatory, but recommended)
- Create multiple websites, their respective stores, and store views.
- Create folders for newly created websites, copy index.php and .htaccess files into these folders and make necessary changes in index.php or .htaccess files.
- Make changes in secure and unsecure Base URLs of different websites from System > Configuration > General (Web) section. Do remember to select a particular website to set Base URL.
Please let me know if you are able to fix the issue.
-
-
If my solution worked for you, please upvote. If not, please share the way, you fixed the problem, so that others can also get the benefit. Commented Nov 3, 2017 at 12:17
-
ok Magneto Multi store Setup first we website created on System->Manage Stores create a website, store and store view. Make a note of the codes as you need those in the code below in that switch($_SERVER['HTTP_HOST']) { case 'first-store.com': case 'www.example1.com': Mage::run('website_code1', 'website'); break; case 'example2.com': case 'www.second-store.com': Mage::run('website_code1'', 'website'); break; default: Mage::run(); break; }– RajeshCommented Nov 3, 2017 at 12:23
-
Please post your solution as answer for better readability and ease of understanding. Commented Nov 3, 2017 at 12:29
Here is very brief guide:
First create the website,store. This is all done via the Magento administration.
System->Manage Stores
for each store that you want, create a website, store and store view. Make a note of the codes as you need those in the code below.
Then in your index.php file have some code like this:
switch($_SERVER['HTTP_HOST']) {
case 'example1.com':
case 'www.example1.com':
Mage::run('website_code1', 'website');
break;
case 'example2.com':
case 'www.example2.com':
Mage::run('website_code2', 'website');
break;
default: //run the default store if for some reason the above hasn't worked.
Mage::run();
break;
}