RewriteRule ^/opac/extras/ac/jacket/(small|medium|large)/$ \
/opac/images/blank.png [P,L]
+# ----------------------------------------------------------------------------------
+# Add the row ID (RID) and date so we can make unAPI happy
+# ----------------------------------------------------------------------------------
RewriteEngine ON
RewriteCond %{QUERY_STRING} (^r|&r)=(\d+)
RewriteRule - - [E=OILS_OPAC_RID:%2]
-RewriteRule - - [E=OILS_TIME_YEAR:%{TIME_YEAR}]
+RewriteRule - - [E=OILS_TIME_YEAR:%{TIME_YEAR}] [L]
+
+# ----------------------------------------------------------------------------------
+# Pull the locale from the URL
+# ----------------------------------------------------------------------------------
+RewriteEngine ON
+RewriteCond %{REQUEST_URI} ^/opac/(.*?)/
+RewriteRule - - [E=locale:%1] [L]
+
# ----------------------------------------------------------------------------------
# Configure the OPAC
# ----------------------------------------------------------------------------------
AddOutputFilter INCLUDES .xsl
AddOutputFilter INCLUDES;XMLENT .xml
- # add languages as necessary
- SetEnvIf Request_URI "/en-US/" locale=en-US
- SetEnvIf Request_URI "/fr-CA/" locale=fr-CA
- SetEnvIf Request_URI "/hy-AM/" locale=hy-AM
SetEnvIf Request_URI ".*" OILS_OPAC_BASE=/opac/
# This gives you the option to configure a different host to serve OPAC images from
# ----------------------------------------------------------------------------------
# Run server-side XUL and XHTML through xmlent to load the correct XML entities
# ----------------------------------------------------------------------------------
-<LocationMatch /xul>
- SetEnvIfNoCase Accept-Language "en" locale=en-US
- SetEnvIfNoCase Accept-Language "fr-CA" locale=fr-CA
- SetEnvIfNoCase Accept-Language "hy-AM" locale=hy-AM
-</LocationMatch>
+RewriteEngine ON
+RewriteCond %{HTTP:Accept-Language} ([a-z]{2}-[A-Z]{2})
+RewriteRule ^/xul/ - [E=locale:%1]
+RewriteRule ^/reports/ - [E=locale:%1] [L]
+
+RewriteEngine ON
+RewriteCond %{HTTP:Accept-Language} !([a-z]{2}-[A-Z]{2})
+RewriteRule ^/xul/ - [E=locale:en-US]
+RewriteRule ^/reports/ - [E=locale:en-US] [L]
+
+# Default to en-US if we are just given en
+RewriteEngine ON
+RewriteCond %{ENV:locale} ^$ [OR]
+RewriteCond %{ENV:locale} ^en$
+RewriteRule - - [E=locale:en-US] [L]
<LocationMatch /xul/.*\.xhtml$>
Options +Includes
# ----------------------------------------------------------------------------------
<LocationMatch /reports>
Options +Includes
- SetEnvIfNoCase Accept-Language "en" locale=en-US
- SetEnvIfNoCase Accept-Language "fr-CA" locale=fr-CA
- SetEnvIfNoCase Accept-Language "hy-AM" locale=hy-AM
AddOutputFilter INCLUDES;XMLENT .xhtml
</LocationMatch>
<LocationMatch /reports/fm_IDL.xml>
# Conify - next-generation Evergreen administration interface
# ----------------------------------------------------------------------------------
RewriteEngine on
-RewriteRule ^/conify/(.*)/global/(.*)$ /conify/global/$2 [E=locale:$1]
+RewriteRule ^/conify/(.*)/global/(.*)$ /conify/global/$2 [E=locale:$1,L]
<Location /conify>
XMLEntStripPI "yes"
XMLEntEscapeScript "no"
# ----------------------------------------------------------------------------------
# Vandelay importers / exporters (your Web interface to bibliographic travel)
# ----------------------------------------------------------------------------------
-# capture the locale from the URL
-AliasMatch ^/vandelay/.*/vandelay.xml(.*) /openils/var/web/vandelay/vandelay.xml$1
+RedirectMatch 301 ^/vandelay/vandelay.xml(.*)$ /vandelay/en-US/vandelay.xml$1
+
+RewriteEngine on
+RewriteRule ^/vandelay/([a-z]{2}-[A-Z]{2})/(.*)$ /vandelay/$2 [E=locale:$1]
+
<LocationMatch /vandelay.*xml>
- RewriteEngine on
- SetEnv locale en-US
- SetEnvIf Request_URI "/en-US/" locale=en-US
- SetEnvIf Request_URI "/fr-CA/" locale=fr-CA
XMLEntStripPI "yes"
XMLEntEscapeScript "no"
XMLEntStripComments "yes"
allow from all
</Location>
-
-
# OpenURL 0.1 searching based on OpenSearch
RewriteEngine on
RewriteMap openurl prg:/openils/bin/openurl_map.pl