I have a newly published site, where the localization does not work properly.
https://www.nomadenschaetze.com/de/
When i switch to english, it shows the right englisch homoepage. Now, when i click another englisch site, for example contact, it does not find the templates. https://www.nomadenschaetze.com/en/contact The url is fine, the links have the right domain-urls, but it always goes to the 404.
In my dev- environment though, it is working: the content and navigation changes to english, https://dev.nomadenschaetze.com/de/
i am very confused.
my general.php looks like this:
// Production environment settings
'production' => [
'siteUrl' => array(
'nomadenschaetze_de' => 'https://www.nomadenschaetze.com/de/',
'nomadenschaetze_en' => 'https://www.nomadenschaetze.com/en/',
),
'allowAdminChanges' => true,
'devMode' => false,
'baseUrl' => 'https://www.nomadenschaetze.com',
'aliases' => [
'@root' => getenv('ROOT'),
'@nomadenschaetze_url' => 'https://www.nomadenschaetze.com',
],
],
i have craft 3, in my web folder are a de and en folder. no .htaccess in there in these language folder.
in the web directory i have a .htacces file
<IfModule mod_rewrite.c>
RewriteEngine On
# language starts with DE
RewriteCond %{HTTP:Accept-Language} ^de [NC]
RewriteRule ^$ /de/ [L,R=301]
# else redirect to the English version
RewriteRule ^$ /en/ [L,R=301]
# Send would-be 404 requests to Craft
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !^/(favicon\.ico|apple-touch-icon.*\.png)$ [NC]
RewriteRule (.+) index.php?p=$1 [QSA,L]
</IfModule>
in the root directory i had to add a .htaccess file, because i cannot change the root directory on the server to "web".
RewriteEngine On
RewriteCond %{HTTP_HOST} ^(www\.)?nomadenschaetze\.com [NC]
RewriteCond %{REQUEST_URI} !^/web/.*$
RewriteRule ^(.*)$ /web/$1
what i am doing wrong?