cancel
Showing results for 
Search instead for 
Did you mean: 

1 Domain - 2 Stores - both of them in English and German - How to get Language Tag in URL?

1 Domain - 2 Stores - both of them in English and German - How to get Language Tag in URL?

Stores:
- automobile
- truck

Languages:
- German
- English

StoreViews Codes:
- automobile German: auto
- automobile English: car
- truck German: laster
- truck English: truck

Desired urls:
- automobile German: example.com/de/auto
- automobile English: example.com/en/car
- truck German: example.com/de/laster
- truck English: example.com/en/truck

Problem
I am able to get the store view code in the url but I am not able to get the language tag in the url. How can I build the aforementioned urls in Magento 2?

1 REPLY 1

Re: 1 Domain - 2 Stores - both of them in English and German - How to get Language Tag in URL?

Hi @Jens_Noma,

 

By dfault you won't get it working in that way (there are some workarounds maybe).

One of the most basic configurations for that is to use a code store that use both codes. I mean:

 

  • de_auto
  • en_auto

So then the url will be different.

Another way to solve this problem is to use different urls per store view: http://devdocs.magento.com/guides/v2.2/config-guide/multi-site/ms_websites.html

 

Maybe you can combine the last option with store codes?