Question

I got multiple Domains for different countries like:
www.domain.de
www.domain.be

Now i want to setup another Website within my Magento installation where www.domain.de is already setup and linked to a website and link the www.domain.be Domain to a new created Website to create a Shop for belgium.

Things I've already done:
• Create a new Website
• Create a Shop for that Website
• Create Storeviews for that Shop
• Configure the Base-URLS on the belgium Website

Belgium -> Belgium Shop -> dutch / french


When i try to access the www.null-bar.be Domain i do not get the right Website ( in fact i get the default screen from my hosting provider ) - The directory is set on the server-configuration.

I saw that i have to change things in the index.php to actually link the other domain to the right Website but none of the articles i've read was clear to understand...

Could anyone link a cleary understandable "tutorial" or article where i can make my stuff possible ?

Was it helpful?

Solution

Please follow http://vagento.com/setup-multi-store-multi-domain-magento-2/ link. I hope that'll help you for Setup Multi Store With Multi Domain in Magento 2.

OTHER TIPS

You seem to have done most of the work as I have not needed to change anything on index.php in the past and have just set the apache virtual hosts as per Dec docs articles at bottom of answer for it to work.

If using apache for web server I just created a new virtual host and added something like below for the new store:

<VirtualHost *:80>
ServerName          german.mysite.mg
DocumentRoot        /var/www/html/magento2/pub/
SetEnv MAGE_RUN_CODE "german"
SetEnv MAGE_RUN_TYPE "website"
</VirtualHost>

As you have set the store up within admin I believe as long as the code matches your code, root and domain matches your store should start to work. You don't seem to have a virtual host set up I believe as the web server is showing default page and would usually redirect to the first store otherwise so you need to do above however unsure of your environment.

Apache http://devdocs.magento.com/guides/v2.0/config-guide/multi-site/ms_apache.html

Nginx http://devdocs.magento.com/guides/v2.0/config-guide/multi-site/ms_nginx.html

@Emipro Technologies Pvt. Ltd.

Thanks for your answer, looks proising so far. The only thing i dont get is this one:

$domain2store = array(
'domain1.com'=>'default', // Replace your Website, Store or Storeview code with this.
'domain2.com'=>'de',      // Replace your Website, Store or Storeview code with this.
'domain3.com'=>'es',      // Replace your Website, Store or Storeview code with this.
'domain4.com'=>'fr',      // Replace your Website, Store or Storeview code with this.
);

Do I just have to fill in the storeview code and it gets the Shop & Website from that ? Or do I have to fill in the Website ID or Shop ID ?

Thank you.

UPDATE AND FINAL ANSWER
Since i wasnt able to create vhosts due "secruity concerns" from my hosting provider i was stuck with editing the index.php. I used the article linked from Emipro Technologies Pvt. Ltd. (which is also marked since it was the only article which was written in an understandable way and i got it to work like that.

Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange
scroll top