Magento: How To Set Up And Manage Multiple Stores With Multiple Domains

If you work with Magento, sooner or later you will end up needing multiple websites that can be managed by one single admin. Recently we came across a project which had the requirement of having twelve different domains but with a single admin. We were required to manage multiple stores with a number of domains by one admin.

The advantage of having this type multistore-multiwebsite concept is that we can create and show variations in the CMS pages, categories, products according to our need and the requirement of store/website. Here is an example of how to manage multiple stores with a single admin:

Also Read: How To Handle JSON Text Through MySQL Queries

First create a Website >>

Name: Website 1

Code: Website_1

Sort Order: 1

Manage Multiple Stores 1

Then create a Store >>

Website: Select from the dropdown the name you have just entered in the “create a Website” section(Ex: Website 1).

Name: Website 1 store

Root Category: Choose any category that you want to use in this website

Manage Multiple Stores 2

Then create a Store View >>

Store: Select from the dropdown the name you have just entered in “create a Store View” section (Ex: Website 1 store).

Name: Website 1 store view

Code: Website_1

Status: Enabled

Sort Order: 1

Manage Multiple Stores 3

NB: Please keep in mind the website code that you have written. We will be using that code in future.

Now go to System->Configuration and select Current Configuration Scope: Website 1. Then change the baselink-url(unsecure) & baselink-url(secure) : place {{unsecure_base_url}}website_1/ and {{secure_base_url}}website_1/ respectively.

We have already created a folder named as “website_1″ in the root folder of Magento. Here we have placed two files >>

1. php

2. htacess

We have copied two files from Magento’s root folder.

For index.php, just place the below code at the end.

1
$mageRunCode = 'website_1'; ////

here we have used the website code

1
2
3
$mageRunType = 'website';
Mage::run($mageRunCode, $mageRunType);

The complete index.php would look like this:

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s