From e0623504fb0466ea4c121df3d124e082cb13762f Mon Sep 17 00:00:00 2001 From: Thomas Berezansky Date: Wed, 25 Apr 2012 11:55:42 -0400 Subject: [PATCH] Default and force patrons to TPac May be incomplete, but better than nothing. Signed-off-by: Thomas Berezansky Signed-off-by: Ben Shum Signed-off-by: Mike Rylander --- Open-ILS/examples/apache/eg_vhost.conf.in | 46 ++++++++++++++++++++++- 1 file changed, 45 insertions(+), 1 deletion(-) diff --git a/Open-ILS/examples/apache/eg_vhost.conf.in b/Open-ILS/examples/apache/eg_vhost.conf.in index 26b0485d01..60605b3c93 100644 --- a/Open-ILS/examples/apache/eg_vhost.conf.in +++ b/Open-ILS/examples/apache/eg_vhost.conf.in @@ -6,7 +6,7 @@ # ---------------------------------------------------------------------------------- # Point / to the opac - if you have a custom skin or locale, point at it here # ---------------------------------------------------------------------------------- -RedirectMatch 301 ^/$ /opac/en-US/skin/default/xml/index.xml +RedirectMatch 301 ^/$ /eg/opac/home # ---------------------------------------------------------------------------------- # Point / to the IP address redirector @@ -86,6 +86,50 @@ RewriteRule . - [E=OILS_OPAC_RID:%2,E=OILS_TIME_YEAR:%{TIME_YEAR}] RewriteCond %{REQUEST_URI} ^/opac/(.*?)/ RewriteRule . - [E=locale:%1] +# ---------------------------------------------------------------------------------- +# Rewrite JSPac->TPac with redirects +# ---------------------------------------------------------------------------------- + +# First things first, extract useful data +# And we are going to start with a "this is the JSPac" check on each of these: +# RewriteCond %{REQUEST_URI} ^/?opac/ + +# Basic (overall) search type, if present +# I am cheating and grabbing RT or TP because I dunno the difference between them. +RewriteCond %{REQUEST_URI} ^/opac/ +RewriteCond %{QUERY_STRING} (^|[^0-9a-zA-Z])(rt|tp)=([^;&]*) +RewriteRule . - [E=OILS_JSPAC_SEARCH_TYPE:qtype=%3;] + +# Basic (overall) search term(s), if present - NOTE: Not doing advanced search. +RewriteCond %{REQUEST_URI} ^/opac/ +RewriteCond %{QUERY_STRING} (^|[^0-9a-zA-Z])t=([^;&]*) +RewriteRule . - [E=OILS_JSPAC_SEARCH_TERMS:query=%2;] + +# Search Location, if present +RewriteCond %{REQUEST_URI} ^/opac/ +RewriteCond %{QUERY_STRING} (^|[^0-9a-zA-Z])l=([^;&]*) +RewriteRule . - [E=OILS_JSPAC_SEARCH_LOCATION:locg=%2;] + +# My Account +RewriteRule /opac/[^/]*/skin/default/xml/myopac.xml /eg/opac/myopac/main?%{ENV:OILS_JSPAC_SEARCH_TYPE}%{ENV:OILS_JSPAC_SEARCH_TERMS}%{ENV:OILS_JSPAC_SEARCH_LOCATION} [NE,R,L] + +# Record Pages +# /opac/en-US/skin/default/xml/rdetail.xml?r=32 -> /eg/opac/record/32 +RewriteCond %{QUERY_STRING} (^|[^0-9a-zA-Z])r=([^;&]*) +RewriteRule /opac/.*/rdetail.xml /eg/opac/record/%2?%{ENV:OILS_JSPAC_SEARCH_TYPE}%{ENV:OILS_JSPAC_SEARCH_TERMS}%{ENV:OILS_JSPAC_SEARCH_LOCATION} [NE,R,L] + +# Bookbag Pages +# /opac/extras/feed/bookbag/html-full/1 -> /eg/opac/results?bookbag=1;page=0;locg=1;depth=0 +RewriteRule /opac/extras/feed/bookbag/html-full/(\d*) /eg/opac/results?bookbag=$1;%{ENV:OILS_JSPAC_SEARCH_TYPE}%{ENV:OILS_JSPAC_SEARCH_TERMS}%{ENV:OILS_JSPAC_SEARCH_LOCATION} [NE,R,L] + +# Search Results Pages +RewriteRule /opac/[^/]*/skin/[^/]*/xml/rresult.xml /eg/opac/results?%{ENV:OILS_JSPAC_SEARCH_TYPE}%{ENV:OILS_JSPAC_SEARCH_TERMS}%{ENV:OILS_JSPAC_SEARCH_LOCATION} [NE,R,L] + +# Basic Search (STILL not doing advanced) +# Fallback! But only for things that end in xml, htm, or html +# Images, CSS, etc can stick around. +RewriteRule /opac/[^/]*/skin/.*(xml|htm|html|/)$ /eg/opac/home?%{ENV:OILS_JSPAC_SEARCH_TYPE}%{ENV:OILS_JSPAC_SEARCH_TERMS}%{ENV:OILS_JSPAC_SEARCH_LOCATION} [NE,R,L] + # ---------------------------------------------------------------------------------- # For sanity reasons, default indexes to Off # ---------------------------------------------------------------------------------- -- 2.43.2