Use these snippets to setup a magento installation with the following structure:
- http://www.domain.tld/en -> website: domain / storeview: domain_en
- http://www.domain.tld/de -> website: domain / storeview: domain_de
- http://www.domain.tld/es -> website: domain / storeview: domain_es
- http://www.domain1.tld/en -> website: domain1 / storeview: domain1_en
- http://www.domain1.tld/de -> website: domain1 / storeview: domain1_de
- http://www.domain1.tld/es -> website: domain1 / storeview: domain1_es
- http://www.domain2.tld/en -> website: domain2 / storeview: domain2_en
- http://www.domain2.tld/de -> website: domain2 / storeview: domain2_de
- http://www.domain2.tld/es -> website: domain2 / storeview: domain2_es
No additional htaccess/apache rewrites required! Make shure you stick to the naming convention mentioned above under System/Manage Stores! Note: A more reliable approach (especially when using proxies/load-balancers e.g. in a setup with varnish upfront) would be to make use of the environment variables in your nginx/apache/php-fpm vhosts and switch them accordingly
fastcgi_param MAGE_RUN_TYPE store;
fastcgi_param MAGE_RUN_CODE domain1_en;
For this to work properly, you also have to manually adjust the settings at
- website: domain / storeview: domain_en / System/Configuration/Web/Unsecure: Base Link Url -> {{unsecure_base_url}}en/
- website: domain / storeview: domain_en / System/Configuration/Web/Secure: Base Link Url -> {{secure_base_url}}en/
- website: domain / storeview: domain_de / System/Configuration/Web/Unsecure: Base Link Url -> {{unsecure_base_url}}de/
- website: domain / storeview: domain_de / System/Configuration/Web/Secure: Base Link Url -> {{secure_base_url}}de/
- website: domain1 / storeview: domain1_en / System/Configuration/Web/Unsecure: Base Link Url -> {{unsecure_base_url}}en/
- website: domain1 / storeview: domain1_en / System/Configuration/Web/Secure: Base Link Url -> {{secure_base_url}}en/
- website: domain1 / storeview: domain1_de / System/Configuration/Web/Unsecure: Base Link Url -> {{unsecure_base_url}}de/
- website: domain1 / storeview: domain1_de / System/Configuration/Web/Secure: Base Link Url -> {{secure_base_url}}de/
- website: domain2 / storeview: domain2_en / System/Configuration/Web/Unsecure: Base Link Url -> {{unsecure_base_url}}en/
- website: domain2 / storeview: domain2_en / System/Configuration/Web/Secure: Base Link Url -> {{secure_base_url}}en/
- website: domain2 / storeview: domain2_de / System/Configuration/Web/Unsecure: Base Link Url -> {{unsecure_base_url}}de/
- website: domain2 / storeview: domain2_de / System/Configuration/Web/Secure: Base Link Url -> {{secure_base_url}}de/