Don't use a different document root for domain1.com and domain2.com. As I understand you, the Magento installation is at domain1/public_html/magento_admin
.
Then point the document root for domain2.com to this directory and instead of hard coding MAGE_RUN_CODE
in index.php
, set it based on the domain, as explained here: Multi Store doesnt work - .htaccess?Multi Store doesnt work - .htaccess?
First of all, you don't need to do any changes in
index.php
. An example apache configuration that you can add at the top of your.htaccess
file is:SetEnv MAGE_RUN_TYPE website SetEnvIf Host magento\.zweitedomain\.de MAGE_RUN_CODE=zweitewebsite
(if
zweitewebsite
is the code of your second website)I usally don't add the
^
and$
delimiters, so that all subdomains or developer instances are matched as well as long the host contains "magento.zweitedomain.de":
- www.magento.zweitedomain.de
- test.magento.zweitedomain.de
- magento.zweitedomain.de.local