Last active
December 16, 2015 05:09
-
-
Save michaelklapper/5382239 to your computer and use it in GitHub Desktop.
Browser language detection
====================
This is a simple rewrite to detect Browser language and redirect to a root page depending on the language setting.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## If the user has a browser with german language | |
## and visits the root page | |
## than redirect to the german default startpage: http://www.HOST.com/de/produkte.html | |
RewriteCond %{HTTP:Accept-Language} ^de.*$ [NC] | |
RewriteRule ^$ http://%{HTTP_HOST}/de/produkte.html [L,R=302] | |
## If the user has a browser with a non german language | |
## and visits the root page | |
## than redirect to the english default startpage: http://www.HOST.com/en/products.html | |
RewriteCond %{HTTP:Accept-Language} !^de.*$ [NC] | |
RewriteRule ^$ http://%{HTTP_HOST}/en/products.html [L,R=302] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment