I'm setting multiple store, I have setup two domains domain1.com and domain2.com

All work is done but I have an issue with the URL

Both domains show pages even I created a new page for second domain but it still shows 1st domain content and all the URL from main domain not the from second domains.

I'm working with magento 1.9

Please guide me

  • Will likely need more info - Are you using multiple store set up or multiple website set up? Did you adjust the URLs under system -> configuration -> web? How are you checking for different sites in server? SetENV method? index.php method? Did you clear the magento cache? Jun 3, 2015 at 17:24
  • we have a main domain domain1.com already running we are adding second domain2.com we have parked it on our server already. and methos we are using is setenv code is SetEvnIf Host ^www\.domain1\.org$ MAGE_RUN_CODE=base MAGE_RUN_TYPE=website SetEvnIf Host ^www\.domain2\.org$ MAGE_RUN_CODE=basecode2 MAGE_RUN_TYPE=website we cleared all the cache more time. both domain showing same website same urls. i added a new home page in domain2 but its still showing domain 1 home page and all
    – Rajnesh
    Jun 5, 2015 at 13:55
  • i think its miss configuration reason its showing same store in all domain we are parking on server. but when we try to change nothing happen. we setup the new website new root category new store view then set a domain name there but still all same using setenv method for redirection but its still same.
    – Rajnesh
    Jun 5, 2015 at 15:07
  • 1
    Rajnesh, if you didn't fix the problem yet, please edit your question and add all the infos from the comments, so it is readable. Jul 10, 2015 at 12:29
  • thanks but all working fine now..
    – Rajnesh
    Jul 11, 2015 at 13:49

1 Answer 1


It would be nice to share the answer with the community Rajnesh :)

I think that the problem was that the store code wasn't correctly set when magento was initiated. There are a few ways to configure this:

  1. htaccess (or nginx) recommended
  2. edit index.php (this is a core hack)
  3. separate directories for each domain and symlink to the magento app (very dirty)

Because I think the first is the one and only good solution I will give an example for that.

  1. Add a new store. System > Manage stores
  2. Open you're .htaccess file and place and edit this code

SetEnvIf Host www.youreurl.com MAGE_RUN_CODE=YOURECODE SetEnvIf Host www.youreurl.com MAGE_RUN_TYPE=website SetEnvIf Host www.youreurl2.com MAGE_RUN_CODE=YOURECODE2 SetEnvIf Host www.youreurl2.com MAGE_RUN_TYPE=website

If this doenst work, you problably run nginx instead of apache. With nginx you have to set the store code with the fastcgi_param like this

fastcgi_param  MAGE_RUN_TYPE website;

The 'YOURECODE' is the code you entered when you created a new website. Left side, in this example its "base" You can enter the urls if you go to System > Configuration > Web > Unsecure & Secure. Example: enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.