(2016-02-19, 21:19:48)HelgeSverre Wrote: How would one go about using 2 separate Tlds/domains (helgesverre.no and helgesverre.com) to determine the language of the page, both domains should be pointing to the same CMS instance, but should display the content in different languages depending on which domain it is.
I added instructions to http://mvlcek.bplaced.net/get-simple/i18n.
To have norwegian on helgesverre.no and the user's preferred language on helgesverre.com, you can have .htaccess rules like this - the user can still switch the language with ?setlang=xx links.
Code:
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.+ - [L]
RewriteCond %{HTTP_HOST} ^helgesverre.no [NC]
RewriteCond %{QUERY_STRING} !(^|&)(set)?lang=
RewriteCond %{HTTP_COOKIE} !(^|;)\s*language=
RewriteRule ^(.*)? $1?lang=no [QSA,DPI]
RewriteRule /?([A-Za-z0-9_-]+)/?$ index.php?id=$1 [QSA,L]
RewriteRule ^ index.php [L]