0

I want to setup up two stores on one installation. Both stores shall be available in English and German.

I want them to be available at the following example urls:

  1. Store: Engineering (German: Maschinenbau) English Store View: https://www.example.com/engineering/en/ German Store View: https://www.example.com/maschinenbau/de/

  2. Store: Industry (German: Industrie) English Store View: https://www.example.com/industry/en/ German Store View: https://www.example.com/industie/de/

Via Stores -> Configuration -> General -> Web I selected each of the four store views and entered the aforementioned URLs in the Base URL and Base Link URL input fields.

The problem is: Now the frontend is broken. No matter what url I enter it always returns a 404. The 404 page comes as plain html, no css is applied.

I furthermore have a question: When I enter https://www.example.com it currently redirects me to the first store view https://www.example.com/engineering/en/. What do I have to change if I want to remain on https://www.example.com/ and get a page that lets the customers select between the two stores: Engineering and Industry?

1 Answer 1

0

You have to create one store and his store view for each, then you go to Stores > Configuration > general > Locale and set the right laguage for each store view to do that you have on the top left the storeview scope.

To switch between stores, you have to add ?___store=yourStoreViewCodeafter domaine for exemple www.domaine.com?___store=fr

About the store switcher, it must appear automatically because now you will create them as I said well before.

Store switcher it appear JUST when you have 2 store views or more under the current website that you are viewing.

Edit:

if you want that your url becomes domaine.com/en or domaine.com/de you have to set that in Unsecure url and Secure url, don't forget to change the storeview scope, And you need to do some mapping for these urls in .htaccessor index.php, you can follow these tutorial.

5
  • Thanks for your answer. But I don't want to make use of url queries when switching between store views. I want to have different url paths since this is better for SEO.
    – Jens
    Commented Mar 24, 2018 at 8:22
  • Look my edit please
    – PЯINCƎ
    Commented Mar 24, 2018 at 10:41
  • Unfortunatelly, it's not working. I am getting a 404 when I type in the url that I entered in Unsecure or secure url. I followed the tutorial but I think it does not apply to my problem since its written for M1. I use M2.
    – Jens
    Commented Mar 24, 2018 at 17:56
  • Sorry, I forget that you're using M2, look again my edit, i changed the tutorial link
    – PЯINCƎ
    Commented Mar 24, 2018 at 20:36
  • The tutorial is not about having multiple stores within one domain. This is my issue. I have looked at Google but it seems that there is no tut on this even though I think this is a common problem.
    – Jens
    Commented Mar 25, 2018 at 10:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.