[MY PAIN] Multiple languages website. Is there any hope?

I’m in the progress of building a multilanguage site. I’m building one project per language. I do the redirects based upon the browser language via a .htaccess rule.

The structure looks somewhat like this:

== root of the website ==
.htaccess
/nl/
-------- index.html
-------- home.html
/fr/
-------- index.html
-------- home.html
/en/
-------- index.html
-------- home.html
/de/
-------- index.html
-------- home.html

The index file in each of the language folders is a age check page, that also gives them the option to manually change the language (if detection was incorrect).

Once entering, the go over to a home page

The rules in my htaccess:

# language starts with DE
RewriteCond %{HTTP:Accept-Language} ^de [NC]
RewriteRule ^$ /de/ [L,R=301]

# language starts with FR
RewriteCond %{HTTP:Accept-Language} ^fr [NC]
RewriteRule ^$ /fr/ [L,R=301]

# language starts with NL
RewriteCond %{HTTP:Accept-Language} ^nl [NC]
RewriteRule ^$ /nl/ [L,R=301]

# else redirect to the English version
RewriteRule ^$ /en/ [L,R=301]

I hope this could be a solution for you too :slight_smile:

8 Likes