--- /dev/null
+These files would go in /openils/conf/, where apache would then read them.
+
+libcode.txt - This is for domain/subdomain to "code" mapping. The code is
+ used as the lookup key on all the other files, as well as for looking
+ up the logo file.
+libname.txt - This is for the library name, for linking to the library in
+ this example, but it could be used without that as well. Note that you
+ need to use something like   instead of spaces in the names.
+libphysloc.txt - This is for the "physical location" that serves as the
+ preferred library when patrons are not logged in. This triggers default
+ search scoping and floating of copies to the top of lists in results.
+liburl.txt - This is for the URL to the library's website, used for linking
+ the logo and creating a link in the topnav links bar.
+
+Note that the libcode lookup specifies a default value. If the domain isn't
+found then "DEFAULT" is used as the code for other lookups.
+
+The libcode is used for logo lookups by seeing if a replacement small/large
+logo exists in /opac/images/LIBCODE/. This can be easily extended to other
+files entirely.
# ----------------------------------------------------------------------------------
# ----------------------------------------------------------------------------------
-# Point / to the opac - if you have a custom skin or locale, point at it here
+# Point / to the opac
# ----------------------------------------------------------------------------------
-RedirectMatch 301 ^/$ /opac/en-US/skin/default/xml/index.xml
+RedirectMatch 301 ^/$ /eg/opac/home
# ----------------------------------------------------------------------------------
# Point / to the IP address redirector
Options -Indexes
# ----------------------------------------------------------------------------------
+# Library Branding
+# ----------------------------------------------------------------------------------
+
+RewriteMap lowercase int:tolower
+RewriteMap libcode txt:/openils/conf/libcode.txt
+RewriteMap liburl txt:/openils/conf/liburl.txt
+RewriteMap libname txt:/openils/conf/libname.txt
+RewriteMap libphysloc txt:/openils/conf/libphysloc.txt
+RewriteRule . - [E=libcode:${libcode:${lowercase:%{HTTP_HOST}}|DEFAULT}]
+RewriteRule . - [E=liburl:${liburl:%{ENV:libcode}}]
+RewriteRule . - [E=libname:${libname:%{ENV:libcode}}]
+RewriteRule . - [E=physical_loc:${libphysloc:%{ENV:libcode}}]
+
+# Logo URLs
+RewriteCond %{REQUEST_URI} /opac//?images//?main_logo.jpg
+RewriteCond %{DOCUMENT_ROOT}/opac/images/%{ENV:libcode}/main_logo.jpg -f
+RewriteRule /opac//?images//?main_logo.jpg /opac/images/%{ENV:libcode}/main_logo.jpg
+
+RewriteCond %{REQUEST_URI} /opac//?images//?small_logo.jpg
+RewriteCond %{DOCUMENT_ROOT}/opac/images/%{ENV:libcode}/small_logo.jpg -f
+RewriteRule /opac//?images//?small_logo.jpg /opac/images/%{ENV:libcode}/small_logo.jpg
+
+# Keyword
+RewriteRule ^/search/keyword/(.*) /eg/opac/results?qtype=keyword&query=$1 [R]
+
+# DB ID (direct load)
+RewriteRule ^/search/id/(.*) /eg/opac/record/$1 [R]
+
+# ISBN
+RewriteRule ^/search/isbn/(.*) /eg/opac/results?_special=1&qtype=identifier|isbn&query=$1 [R]
+
+# My account
+RewriteRule ^/myaccount https://%{HTTP_HOST}/eg/opac/myopac/main [R]
+
+# ----------------------------------------------------------------------------------
# Configure the OPAC
# ----------------------------------------------------------------------------------
<LocationMatch /opac/>
- <div id="topnav_logo"> <a href="http://evergreen-ils.org"><img alt="[% l('Evergreen Logo') %]"
- src="[% ctx.media_prefix %]/opac/images/small_logo.png" /></a></div>
+ <div id="topnav_logo">
+[% IF ENV.liburl && ENV.libname %]
+ <a href="[% ENV.liburl %]"><img alt="[% l(ENV.libname) %]"
+[% ELSE %]
+ <a href="http://www.evergreen-ils.org"><img alt="[% l('Evergreen Logo') %]"
+[% END %]
+ src="[% ctx.media_prefix %]/opac/images/small_logo.jpg" /></a>
+ </div>