How To Set Up Multiple Websites In Magento

Published on January 5, 2012 by      Print
How To Set Up Multiple Websites In Magento

One good thing about Magento is that you can manage multiple ecommerce stores from the same admin panel. You can use the same products on both stores, or separate them out by category. Anyway, you already know that I do not suggest using Magento Community without strong programming knowledge or a Magento ninja always at the ready.

Store view vs. Website

  • A Website is an entirely new Ecommerce store that uses the same instance of Magento. All orders are still processed in the same backend, but each store is unique.
  • A store view is a different way of viewing a part of your store or a specific category. For example, you may create a Spanish Store View, English Store View, and French Store View. Got it?

Create new Website instance and store view

1. In the back end, navigate to System -> Manage Stores

2.Click the “Create Website” button in the top right of the page

3. Fill in the name and code and click save. The code is the alpha numeric identifier you give your store

4. Click the “Create Store” button at the top right. Select your new website from the drop down and the root category you want to use for the store. Save.

5. Click the “Create View” button at the top right. Make sure to select the Website and Store you want the view to appear in as well as give it a unique identifier, such as newstore-english.

6. Go to Configuration -> General Tab -> Web

Once you have followed these steps, you will now need to move on to actually viewing your new store and beginning development.

There are many ways to set up your Magento stores. Sub domains, parked domains, sub-directories and addon domains. I will be using the Sub-directory method for the domain because it suits my needs. However, there is a great tutorial for the other types here.

Adding Magento to a sub-directory

No, you could do this for an addon domain, but you will need to take additional steps. I am actually creating this additional Website in order to develop a new theme on a live site. Here we go.

1. Create a new directory for your store

2. Put a copy of your main stores index.php and .htaccess in the directory

3. Find the following line (around line 45)

$mageFilename = 'app/Mage.php';

4. Change the line of code so index.php can find Mage.php.

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

5. Search for the following line of code in index.php: Mage::run($mageRunCode, $mageRunType);

6. Directly above that line of code add the new store code:


$mageRunCode = 'your_store_name';
$mageRunType = 'website';

So, all of the code will look like this together:


$mageRunCode = 'your_store_code';
$mageRunType = 'website';
Mage::run($mageRunCode, $mageRunType);

Now, navigate to your sub-directory and you should see your store. If you get an error message, post it in the comments and maybe we can figure it out.

Filed under: Ecommerce and Tagged: Tags:

Did You Enjoy This Article?

Get FREE Updates, Enter Your Email Address:

Delivered by FeedBurner



3 Comments !

  1. dan @ prepaid wifi says:


    dude, some of the images are broken on the page. Is Magento it’s own CMS or is it a part of wordpress? -Dan

  2. Aleksandre says:


    Thanks man for the useful article! Always wanted to use Magento. Though for the better understanding please fix the images. I can’t see any of them.

    Regards.

  3. Jason Capshaw says:


    Sorry about the images, switched to simple helix hosting. Will have issue resolved soon.


Leave a Reply

Asterisk (*) marked fields are required

Switch to our mobile site