read the browser language
redirect to the coresponding language page (/en, /de, ...)
if there is no browser language/prefix match, redirect to /en as fallback
I foud a good example in this blog post, which I summerised here:
RewriteEngine On
RewriteCond %{HTTP:Accept-Language} ^de [NC]
RewriteRule ^/$ /de/ [L,R=301]
RewriteCond %{HTTP:Accept-Language} ^es [NC]
RewriteRule ^/$ /es/ [L,R=301]
RewriteCond %{HTTP:Accept-Language} ^pl [NC]
RewriteRule ^/$ /pl/ [L,R=301]
RewriteRule ^/$ /en/ [L,R=301]As you can see in the first line, the apache server uses the rewrite mod. The second and third line you can see as a pair, where RewriteCond is the rewrite condition and the RewriteRule is the rule if the condition matches.
So if the request header parameter Accept-Language starts with de, the respond with moved permanently (301) and the new path /de should be provided.
The last line is the fallback rule tho the english language.




Help





