Search code examples
.htaccessmagentosubdomainmagento-1.9

Magento - Create different store view (languages) on the same domain


I create more store views in my Magento 1.9 store, how I can add a subdomain per each store view.

For example I create a new store with the name eu where I setup the language to be english and I need to add a subdomain for this store view: eu.example.com but my url is something like this: http://example.com/?___store=de&___from_store=eu.

I made the steps like in this image, what I need to do to have this subdomain: eu.example.com to the eu store view?

enter image description here

Also I try to add something like this in .htaccess without success:

RewriteCond %{HTTP_HOST} ^eu.example.com
RewriteRule ^ - [E=MAGE_RUN_CODE:eu]

Solution

  • You have to add this in your vhost file :

    SetEnvIf Host ".*eu.*" MAGE_RUN_CODE=eu MAGE_RUN_TYPE=store