new redirector
Plain text
code posted
created at 16 Sep 16:34
Edit
|
Back
1 2 3 4 5 6 7 8 9 10 11 12 |
# Automatically redirect requests on / according to the
# "Accept-Language" HTTP header, if a translation is
# available for that language.
RewriteEngine On
RewriteCond %{HTTP:Accept-Language} (\w\w)
RewriteCond %{DOCUMENT_ROOT}/%1 -d
RewriteRule ^/$ /%1/ [QSA,R=302,L]
# If not, go to English.
RewriteCond %{HTTP:Accept-Language} (\w\w)
RewriteCond %{DOCUMENT_ROOT}/%1 !-d
RewriteRule ^/$ /en/ [QSA,R=302,L]
|
510 Bytes in 2 ms with coderay