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.
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.
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.
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.
Also, set “yes” as the Is Anchor.
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.
Now, write the name and code for the new site.
We’ll now create a store for our multi store setup by going to System > Manage Stores and clicking on Create Store.
Set the Website and Root Category to the ones we just created, and name the site whatever you want.
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.
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.
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.
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';
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.
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”.
From the Current Configuration Scope option, access your second store’s view.
In the Web tab, uncheck the Use Website option and set your second domain’s URL as the Base URL.
Click on save and you’re good to use your Magento multi store functionality!