1

We are trying to setup a second language. We've gone through the steps and created a second website, we defined the base URL as @web/de for the second language (German).

The deeper sections are working fine (e.g. www.url.com/de/kontakt). However we can't get the second homepage to work on the URL www.url.com/de. We get a 403 access denied from nginx. We followed all the steps in the documentation (https://docs.craftcms.com/v3/localization.html), but can't get it to work. I assume we are missing something or forgot to do something.

The homepage is a single. In sections, we have left the URI blank for both, the default english site as well as the german site. The template is the same for both.

As a dev environment, we are using Local by Flywheel on a local workstation.

Here are some screenshots of our configuration: enter image description here

Site overview: enter image description here

1

Did you define the the locale url in your config?

I do it like this:

.env

SITE_URL_DE="@web"
SITE_URL_EN="@web/en"
SITE_URL_FR="@web/fr"
SITE_URL_IT="@web/it"

general.php

// Global settings
  '*' => [
    'siteUrl' => [
        'siteDe' => getenv('SITE_URL_DE'),
        'siteFr' => getenv('SITE_URL_FR'),
        'gsiteEn' => getenv('SITE_URL_EN'),
        'siteIt' => getenv('SITE_URL_IT'),
    ],
  ],

Then you can use those as your base URL's:

enter image description here

| improve this answer | |
  • Thank you for your answer. We hadn't set those variables. We have added them, however it still doesn't work. I wonder, we haven't set an index.php in the web/de folder - do we need this? I've added some screenshots to show how my configuration looks. – Ludwig Seufert Oct 2 '18 at 12:00
  • You don't need to have web/de folders any longer in Craft 3 – KSPR Oct 2 '18 at 13:23
  • Hmm. Apart from that it looks the same. I run on apache so my guess it's an ngnix thing. – KSPR Oct 2 '18 at 13:25
  • Seriously...that was it. We removed the de folder and now everything works fine. Thank you very much. – Ludwig Seufert Oct 2 '18 at 13:45
  • Glad to hear. The move from a multilanguage site from craft 2 to craft 3 isn't that strightforward altough it's much simpler now actually. – KSPR Oct 3 '18 at 6:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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