Magento 2 – How to Set One Domain for Each Language

configurationlanguagemagento2websites

I need to redirect my magento to another domain after changing the language.

Example:

  • After select English – switch domain to mydomain.co.uk

  • After select Czech Republic – switch domain to mydomain.cz

Anyone know how to do ?

@Prince

Can you explain me more ? I have two languages set up and a working store switcher.

When I switch language then I get url:

From EN to CZ:

http://myweb.com/?___store=cz&___from_store=en

FROM CZ TO EN:

http://myweb.com/?___store=en&___from_store=cz

only now instead:

http://myweb.com/?___store=cz&___from_store=en

I want redirect:

http://myweb.cz/

EDIT2:
I have created new website_Cz:
enter image description here

and set language cz for new website

but now I cannot see this language on frontend switcher.

enter image description here

I know I'm still doing it wrong, I will be grateful if you can help me solve this problem.

Best Answer

According to your requirements, you have to create two websites with :

  • one language for each website
  • one domaine for each website

To switch between the two languages, you have to add some storeswitcher or a dropdown input.

EDIT:

You have this ?___store=... in your urls because you are using just one website with different storeview ! this is why i told you to use two websites and you create and set just one store and one view for each website, you set en language for the first website and cz for the the second.

nb: the languages you set them in the store view Stores -> All stores -> Storeview code and in Locale Stores -> Configuration -> General

More informations

EDIT 2: Please read my first reply :

"To switch between the two languages, you have to add some storeswitcher or a dropdown input."

The store switcher appear JUST when you have 2 store views under the current website that you are viewing.

Since you have only one store view for each website this doesn't appear.

You can Follow these tuto to set well your website config in admin and server part.

Create Multi Website/Stores in magento 2

http://www.dckap.com/blog/how-to-setup-multiple-stores-in-magento2/

Related Topic