Title / Description
Code # 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 %{DOCUMENT_ROOT}/%1 !-d RewriteRule ^/$ /en/ [QSA,R=302,L]
Author
Highlight as C C++ CSS Clojure Delphi ERb Groovy (beta) HAML HTML JSON Java JavaScript PHP Plain text Python Ruby SQL XML YAML diff code