cancel
Showing results for 
Search instead for 
Did you mean: 

Multiple store, two domains

Multiple store, two domains

Hi,

I have some problem with setting up multiple stores. 

 

The magento site is running at ip-address/magento

 

Then I have the first store, that is working on ip-address/magento, code base, and run website

 

The second store is an other domain to I want to be on the same address, ip-address/Magento but the when customer has enter domain2.com they should land on the second site. 

 

Should the base url in magento 2 for the second store be domain2.se/magento or the ip-address/magento

 

Have enter the following in htaccess

SetEnvIf Host .*domain1.com.* MAGE_RUN_CODE=base

SetEnvIf Host .*domain1.com.* MAGE_RUN_TYPE=website

SetEnvIf Host .*domain2.se.* MAGE_RUN_CODE=domain2

SetEnvIf Host .*domain2..se.* MAGE_RUN_TYPE=website

 

RewriteCond %{HTTP_HOST} ^(.*)domain1\.com

RewriteRule .* – [E=MAGE_RUN_CODE:base]

RewriteCond %{HTTP_HOST} ^(.*)domain1\.com

RewriteRule .* – [E=MAGE_RUN_TYPE:website]

 

RewriteCond %{HTTP_HOST} ^(.*)domain2/.se

RewriteRule .* – [E=MAGE_RUN_CODE:domain2]

RewriteCond %{HTTP_HOST} ^(.*)domain2/.se

RewriteRule .* – [E=MAGE_RUN_TYPE:website]

 

Thanks