4

I am trying to get a magento installation to run multiple websites I have completed most of the steps including a parked domain. However I am unsure as to how to answer the statement below:

Easiest amongst these is .htaccess solution which requires you to define the following lines:

SetEnvIf Host .*myhost.* MAGE_RUN_CODE="base";
SetEnvIf Host .*myhost.* MAGE_RUN_TYPE="website";

Simply ensure that .myhost. is a regex expression matching the domain for which you want to set environmental variables for.

For example do my website is www.domain.com and also www.domain1.com, magento is installed on domain.com so for the host do I put .domain.com. and leave the run code and type and base and website

Wes Crow
  • 2,971
  • 20
  • 24
user1220486
  • 101
  • 3
  • 11

1 Answers1

5

What you are supposed to change is the MAGE_RUN_CODE to match the code of the site that is managed in the Magento backend. You also need to change the myhost bit match the domain name of your site.

So for example, if your site is hosted on somewebsite.com and you have two "stores" (Store View A and Store View B, Where "ViewA" is Store View A and "ViewB" is Store View B.)

You would write the following:

SetEnvIf Host .*somewebsite.* MAGE_RUN_CODE=ViewA
SetEnvIf Host .*somewebsite.* MAGE_RUN_TYPE=website

SetEnvIf Host .*somewebsite.* MAGE_RUN_CODE=ViewB
SetEnvIf Host .*somewebsite.* MAGE_RUN_TYPE=website

This assuming you made two different "Sites" in the Magento Backend. If you made a different store, you'd replace "website" with store.

More reading on the Magento renaming can be found here:

http://www.magentocommerce.com/wiki/4_-_themes_and_template_customization/navigation/multiple-website-setup

Lee Saferite
  • 3,124
  • 22
  • 30
Paul Williams
  • 1,554
  • 7
  • 40
  • 75
  • Also do I need to add the "http://www.domain.co.uk" or just "domain" and the .* ? – user1220486 Feb 23 '12 at 14:51
  • You shouldn't have to. Since the .htaccess file resides on your domain, it wouldn't matter since it affects only YOUR domain. If I had a site named somedomain.com and you had a domain named somedomain.co.uk, when a user hits somedomain.co.uk they only see YOUR .htaccess and not mine. – Paul Williams Feb 23 '12 at 14:53
  • As a hint, the default run type is 'website' already so no need to specify it directly. – Lee Saferite Oct 08 '14 at 16:01