Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # First, we need to set the OPAC_LIBRARY_ID environment variable. This should be in
- # eg_vhost.conf already.
- #----------------------------------------------------------------------------------
- # Add the library ID (OILS_OPAC_LIBRARY_ID)
- #----------------------------------------------------------------------------------
- RewriteEngine ON
- RewriteCond %{QUERY_STRING} (^loc|&loc|;loc|^locg|&locg|;locg)=(\d+)
- RewriteRule . - [E=OILS_OPAC_LIBRARY_ID:%2]
- # Further down, we add the RewriteMap entries for the configuration files in the
- # eg_vhost.conf:
- RewriteMap lowercase int:tolower
- RewriteMap libcode txt:/openils/conf/libcode.txt
- RewriteMap libtarget txt:/openils/conf/libtarget.txt
- RewriteRule . - [E=libcode:${libcode:${lowercase:%{HTTP_HOST}}|CWMARS}]
- RewriteRule . - [E=libtarget:${libtarget:%{ENV:libcode}}]
- RewriteRule . - [E=OILS_OPAC_LIBRARY_ID:${libtarget:%{ENV:libcode}}]
- RewriteRule . - [E=physical_loc:${libtarget:%{ENV:libcode}}]
- # The above depends on having two files: /openils/conf/libcode.txt and
- # /openils/conf/libtarget.txt.
- # libcode.txt has line entries like the following
- host.domain.tld code
- # Where host.domain.tld is the fully qualified domain name of the site and code
- # is a code to represent the library. (We use the library's shortname from the
- # actor.org_unit table as the code.)
- # libtarget.txt has line entries like the following:
- code id
- # Where code is the code from libcode.txt and id is the location's id from the
- # actor.org_unit table.
- # If there's more to it, I'm not sure. :)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement