<p>I finally found the solution!</p>
<p>i was not aware, that the document-root HAS to point to the /web folder.
There were old web applications on the server, which prevented
to change the root. So i made the .htaccess file, to redirect to the
/web folder.</p>
<p>But apparently, this is not going to work.
So keep in mind, to point to the right folder.</p>

CC BY-SA 4.0
2020-10-06T08:55:59.973Z
2020-10-06T08:55:59.973Z
Henrik
<p>I have a newly published site, where the localization does not work properly.</p>
<p><a href="https://www.nomadenschaetze.com/de/" rel="nofollow noreferrer">https://www.nomadenschaetze.com/de/</a></p>
<p>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.
<a href="https://www.nomadenschaetze.com/en/contact" rel="nofollow noreferrer">https://www.nomadenschaetze.com/en/contact</a>
The url is fine, the links have the right domain-urls, but it always goes to the 404.</p>
<p>In my dev- environment though, it is working:
the content and navigation changes to english,
<a href="https://dev.nomadenschaetze.com/de/" rel="nofollow noreferrer">https://dev.nomadenschaetze.com/de/</a></p>
<p>i am very confused.</p>
<p>my general.php looks like this:</p>
<pre><code> // Production environment settings
    'production' =&gt; [
        'siteUrl' =&gt; array(
            'nomadenschaetze_de' =&gt; 'https://www.nomadenschaetze.com/de/',
            'nomadenschaetze_en' =&gt; 'https://www.nomadenschaetze.com/en/',
        ),
        'allowAdminChanges' =&gt; true,
        'devMode' =&gt; false,
        'baseUrl' =&gt; 'https://www.nomadenschaetze.com',
        'aliases' =&gt; [
            '@root' =&gt; getenv('ROOT'),
            '@nomadenschaetze_url' =&gt; 'https://www.nomadenschaetze.com',
        ], 
    ],
</code></pre>
<p>i have craft 3, in my web folder are a de and en folder. no .htaccess in there in these language folder.</p>
<p>in the web directory i have a .htacces file</p>
<pre><code>&lt;IfModule mod_rewrite.c&gt;
   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]
&lt;/IfModule&gt;
</code></pre>
<p>in the root directory i had to add a .htaccess file, because i cannot change the root directory on the server to &quot;web&quot;.</p>
<pre><code>RewriteEngine On
RewriteCond %{HTTP_HOST} ^(www\.)?nomadenschaetze\.com [NC]
RewriteCond %{REQUEST_URI} !^/web/.*$
RewriteRule ^(.*)$ /web/$1
</code></pre>
<p>what i am doing wrong?</p>

CC BY-SA 4.0
2020-10-06T06:27:18.953Z
Do you have any .htaccess?
Matthias Redl-Mann
CC BY-SA 4.0
2020-10-06T07:14:58.383Z
i updated my question. a .htaccess file in the web folder, and one in the root directory.
Henrik
<templating><localization>
localized site - except home, every page gives me a 404
# localized site - except home, every page gives me a 404

(Asked by: username_0 on 2020-10-06)

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

   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]


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?

**Tags:** templating, localization
> **Comments:**
> **username_1**: Do you have any .htaccess?  
> **username_0**: i updated my question. a .htaccess file in the web folder, and one in the root directory.  

---

## 1 answers

### Answer by username_0 on 2020-10-06. Score: 1

I finally found the solution!

i was not aware, that the document-root HAS to point to the /web folder.
There were old web applications on the server, which prevented
to change the root. So i made the .htaccess file, to redirect to the
/web folder.

But apparently, this is not going to work.
So keep in mind, to point to the right folder.


---

