Created
November 8, 2016 10:58
-
-
Save sftsk/5a0f1f6df7c5202e7fb487a09be8787a to your computer and use it in GitHub Desktop.
Browser language based forward .htaccess
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
# redirect first visitors basing on their language or redirect if language not specified | |
# in URL. If italian, redirect to italian | |
# if lang is Italian use it | |
RewriteCond %{THE_REQUEST} !\s/(de|it|app|wp)/ [NC] | |
RewriteCond %{HTTP:Accept-Language} ^it [NC] | |
RewriteRule ^ /it%{REQUEST_URI} [L,NC,R=301] | |
# otherwise use German | |
RewriteCond %{THE_REQUEST} !\s/(de|it|app|wp)/ [NC] | |
RewriteRule ^ /de%{REQUEST_URI} [L,NC,R=301] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment