Be consistent about our locale patterns (xx-YY)
authordbs <dbs@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 10 Dec 2008 04:16:27 +0000 (04:16 +0000)
committerdbs <dbs@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 10 Dec 2008 04:16:27 +0000 (04:16 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@11488 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/examples/apache/eg_vhost.conf

index 672fb61..38103a2 100644 (file)
@@ -96,8 +96,8 @@ RewriteRule - - [E=locale:%1] [L]
 
 RewriteEngine ON
 RewriteCond %{QUERY_STRING} locale=([^&]*)
-RewriteRule ^/opac/[^/]+/extras/slimpac/(.*)$ /opac/%1/extras/slimpac/$1? [redirect]
-<LocationMatch /opac/[^/]+/extras/slimpac/>
+RewriteRule ^/opac/[a-z]{2}-[A-Z]{2}/extras/slimpac/(.*)$ /opac/%1/extras/slimpac/$1? [redirect]
+<LocationMatch /opac/[a-z]{2}-[A-Z]{2}/extras/slimpac/>
     AddOutputFilter INCLUDES;XMLENT .html
 </LocationMatch>
 
@@ -109,6 +109,7 @@ RewriteCond %{HTTP:Accept-Language} ([a-z]{2}-[A-Z]{2})
 RewriteRule ^/xul/     -       [E=locale:%1]
 RewriteRule ^/reports/ -       [E=locale:%1] [L]
 
+# Default to en-US if we haven't matched a locale of the form xx-YY 
 RewriteEngine ON
 RewriteCond %{HTTP:Accept-Language} !([a-z]{2}-[A-Z]{2})
 RewriteRule ^/xul/     -       [E=locale:en-US]
@@ -313,7 +314,7 @@ RewriteRule - - [E=locale:en-US] [L]
 # Conify - next-generation Evergreen administration interface
 # ----------------------------------------------------------------------------------
 RewriteEngine on
-RewriteRule ^/conify/(.*)/global/(.*)$ /conify/global/$2 [E=locale:$1,L]
+RewriteRule ^/conify/([a-z]{2}-[A-Z]{2})/global/(.*)$ /conify/global/$2 [E=locale:$1,L]
 <Location /conify>
     XMLEntStripPI "yes"
     XMLEntEscapeScript "no"