Install envif Host Magento Multiple Stores

I am trying to install magento to run several websites on which I have completed most of the steps, including a parked domain. However, I am not sure how to answer the expression below:

The easiest solution 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"; 

Just make sure .myhost. is the regular expression expression corresponding to the domain for which you want to set environment variables for.

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

+4
source share
1 answer

What you need to change is 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 corresponding to the domain name of your site.

So, for example, if your site is hosted on someebsite.com and you have two โ€œstoresโ€ (Store View A and Store View B, where โ€œViewAโ€ is a view of store A and โ€œViewBโ€ is a view of store B.)

You should 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 assumes that you have created two different "Sites" in the Magento Backend. If you created another store, you would replace the "website" with the repository.

More information on renaming Magento can be found here:

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

+5
source

Source: https://habr.com/ru/post/1398043/


All Articles