# ----------------------------------------------------------------------------------
# Run server-side XUL and XHTML through xmlent to load the correct XML entities
# ----------------------------------------------------------------------------------
-RewriteCond %{HTTP:Accept-Language} ([a-z]{2}-[A-Z]{2})
-RewriteRule ^/xul/ - [E=locale:%1]
-RewriteRule ^/reports/ - [E=locale:%1]
-
+RewriteCond %{HTTP:Accept-Language} ^([a-z]{2}-[A-Z]{2})$
# Default to en-US if we haven't matched a locale of the form xx-YY
-RewriteCond %{HTTP:Accept-Language} !([a-z]{2}-[A-Z]{2})
-RewriteRule ^/xul/ - [E=locale:en-US]
-RewriteRule ^/reports/ - [E=locale:en-US]
-
-# Default to en-US if we are just given en
-RewriteCond %{ENV:locale} ^$ [OR]
-RewriteCond %{ENV:locale} ^en$
-RewriteRule . - [E=locale:en-US]
+RewriteRule .? - [S=4]
+RewriteRule ^/xul/ - [E=locale:en-US]
+RewriteRule ^/reports/ - [E=locale:en-US]
+RewriteRule .? - [E=locale:en-US]
+RewriteRule .? - [S=3]
+# Otherwise, set our real locale
+RewriteRule ^/xul/ - [E=locale:%{HTTP:Accept-Language}]
+RewriteRule ^/reports/ - [E=locale:%{HTTP:Accept-Language}]
+RewriteRule .? - [E=locale:%{HTTP:Accept-Language}]
<LocationMatch /xul/.*\.x?html$>
Options +Includes