Magento Tutorials

How to Set Up Magento Multi Store Functionality

In this tutorial, we’ll learn what Magento multi store functionality is and how to setup Magento multi store. I know it sounds exciting, so let’s get started right away!

What Is Magento Multi Store?

Magento comes with a number of powerful and helpful features that mostly go unnoticed by the people who install and use it. Multi store development is one such feature, which can help users tremendously and is one of the more advanced features. Since this feature doesn’t have a general name, we’ll be calling it multi store functionality.

Through multi store development, you can use a single Magento installation to create any number of stores. This is an extremely convenient feature for those who want to create separate stores on different domains controlled by a single administrative center. For an even more granular control, you can create separate stores on the same domain to distinguish between products.


Computing Power

You need to choose your servers carefully. Running even a single store on a single installation can be quite taxing on most shared hosts, so you can imagine what would happen if you setup Magento multi store functionality. Make sure your server can handle a multi store setup. If you use a low amount of products, suppose less than 100, it shouldn’t be a problem. However, if the total number of products is more than 500, it should be a concern.

Version of Magento You Are Using

Setting up a multi store development will need the 1.4.X.X version or higher. A multi store setup could work with older versions, but it is a more complicated, lengthy and error-prone affair. The latest versions bring more features to the table and are more stable, so I will be focusing only on them. If you are using an older version, it is highly recommended that you back up everything and upgrade.

Step 1

If your installation of Magento uses the default value for the URL, we will have to change that by going to System > Configuration and changing the Base URL value under the Web category. Use a URL that best reflects your local setup.

Magento Multi Store Functionality URL

We’ll now create a root category for the new store in your multi store setup. To do so, go to Catalog > Manage Categories and click on Add Root Category. Give a name to the new root category in your multi store development and make it active.

Magento Multi Store Setup Add Root Category

Also, set “yes” as the Is Anchor.

Setup Magento Multi Store Is Anchor

Step 2

We’ll first setup Magento multi store functionality in the back-end by creating the new site. To do so, go to System > Manage Stores and click on Create Website.

Magento Multi Store Development Create Website

Now, write the name and code for the new site.

Magento Multi Store New Website

Step 3

We’ll now create a store for our multi store setup by going to System > Manage Stores and clicking on Create Store.

Magento Multi Store Create Store

Set the Website and Root Category to the ones we just created, and name the site whatever you want.

Magento Multi Store New Store

Step 4

In this next step to setup Magento multi store functionality, we’ll set up the new store view. To do so, go to System > Manage Stores and click on Create Store View.

Magento Multi Store Create Store View

Choose the relevant store, and type in a name and code for the store view. Also, don’t forget to set its State to enabled.

Magento Multi Store New Store View

Step 5

We’ll now prep the domain. To do so, FTP to the server of the Magento installation and copy the htaccess and index.php files over to the new domain.

Magento Multi Store Copy Files

Open the index.php file and change this code at about line 45:

$mageFilename = '$mageFilename = 'app/Mage.php';';

To this if your sites are under sub-folders in your server:

$mageFilename = '../magento/app/Mage.php';

If your installation is in your account root and the other site in a parked domain, change it to this:

$mageFilename = '../app/Mage.php';

Step 6

Now, open the htaccess file and add this code:

SetEnvIf Host .*base.* MAGE_RUN_CODE="base";
SetEnvIf Host .*magento_site_2.* MAGE_RUN_TYPE="magento_site

Note that we’ve used the website code we typed in earlier.

Step 7

This is the final step to setup Magento multi store. Go to System > Configuration, open the Web tab, and set Redirect to Base URL to “no”.

Magento Multi Store Redirect

From the Current Configuration Scope option, access your second store’s view.

Magento Multi Store Current Configuration Scope

In the Web tab, uncheck the Use Website option and set your second domain’s URL as the Base URL.

Magento Multi Store Second Store View

Click on save and you’re good to use your Magento multi store functionality!

About the author

Tabish Shaikh

Website designer, website developer, blogger and a writer. These are the things I like, love and live for. Having years of experience in each field. Developing sites since childhood. Getting the most complicated things done is my specialty. Providing each and everything of top most quality to each and every client.

Leave a Comment