Choose language based on domain

Hi community!

I’ve just released a new grav based website and now want to map different domains to a grav language route. Currently all domains go to the default language.

For example:

domain.com > domain.com/en
domain.de > domain.de/de

Any ideas how to get this behaviour? Maybe it can be realised with the right .htaccess entrys?

Thanks for your help!

Check this out Multi-language with specific domains

Hey rhukster. Thanks a lot for your fast reply and your fantastic support here in this forum.

But the problem that I had was not to switch the TLD when a user switch the site language. Instead I try to map a TLD to a specific site language. Meanwhile I fix it myself by adding the following lines to my .htaccess:

# Rewrite (www.)domain.de to www.domain.de/de
RewriteCond %{HTTP_HOST} ^(www\.)?domain\.de$ [NC]
RewriteCond %{REQUEST_URI} ^/$
RewriteRule ^(.*)$ http://www.domain.de/de/ [L,R=301]
---