RSS

Magento Multi-Store on Multiple Domains

09 Dec

Here is procedure.

suppose u want run two magento store with same admin area on two different domain names eg. domain.com and domain1.com then follow this post:

1: Create New Root Category For Assigning To New Website.

2: Store Configuration in the Magento Admin

1. Now that we have created our Categories, it’s time to create our websites by going to System -> Manage Stores and clicking the “Create Website” button.

  • Name – domain name of our new website
  • Code – a parameter that will be used in configuring the Apache web server to point to that particular domain name

image

2. Once the website has been created, we’ll create the store corresponding to this website by clicking on the “Create Store” button in System -> Manage Stores.

  • Website – website to which this store will be associated
  • Name – the same as the website name
  • Root Category – the root category that will be used for this store. (Refer to Step 1 for Details)

image

3. Then, we create the store view which is the interface that the customer will be able to access on the frontend.  Click the “Create Store View” button in System -> Manage Stores.

    • Store – store to which this view will be associated
    • Name – name of this store view (i.e. English Version, German Version, etc.)
    • Code – code for this store view
    • Status – if enabled, this store view will be accessible from our frontend, otherwise, it will not be accessible

image

4. After the Store has been created, we need to configure the Unsecure Base URL and Secure Base URL under System -> Configuration -> General -> Web.  Before we set their respective base URLs, we first need to ensure that the configuration scope is set to the domain1.com website to define which site we are working on.

image

Then, we modify the base URLs for both Unsecure:

image

and Secure:

image

with the corresponding domain name by unchecking the ”Use default [STORE VIEW]” checkbox and then save the configuration.

5. Now we just repeat Steps 2-4 for the other two websites, domain2.com and domain3.com by replacing the fields with their respective information.

3: Modify URL Redirecting

  1. Still under “System -> Configuration” change the “Current Configuration Scope” to “Default Config”.
  2. Select “Web” from the left sidebar under the General section.
  3. For “URL Options -> Auto-redirect to Base URL” set to “No”.
  4. Click the “Save Config” button.

4: Adding parked domain to cPanel

  1. Change the domain’s DNS name servers to your servers. If in doubt, ask your hosting provider for help.
  2. Log into your cPanel and go to “Domains -> Parked Domains”
  3. Add the domain example.com and click “Add Domain”

 

5: Modifying .htaccess

  1. Edit the .htaccess file in the document root of your Magento Installation and enter the following just above the line RewriteEngine On:
  2. SetEnvIf Host domain1.com MAGE_RUN_CODE=domain1_com
    SetEnvIf Host domain1.com MAGE_RUN_TYPE=website
    Where domain1_com is code of website
  1.  If SetEnvIf Doesn’t Work then

    Enter the following right below the line #RewriteBase /magento/:

    RewriteCond %{HTTP_HOST} domain1.com [NC]
    RewriteRule .* – [E=MAGE_RUN_CODE:domain1_com]
    RewriteCond %{HTTP_HOST} domain1.com [NC]
    RewriteRule .* – [E=MAGE_RUN_TYPE:website]

Done!

If all has gone to plan, then you will now have the same instance of Magento running on two separate domain names.

I successfully implemented this in magento 1.6.1.0.

 
2 Comments

Posted by on Dec 9, 2011 in Magento

 

Tags: , , , , ,

2 responses to “Magento Multi-Store on Multiple Domains

  1. Affect Media

    Mar 13, 2012 at 7:29 pm

    WAUW! the first one that DOES work!

    THNKS THNKS THNKS

     

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

 
%d bloggers like this: