[open-ils-commits] r18890 - branches/rel_2_0/Open-ILS/examples/apache (dbs)

svn at svn.open-ils.org svn at svn.open-ils.org
Tue Nov 30 16:11:40 EST 2010


Author: dbs
Date: 2010-11-30 16:11:35 -0500 (Tue, 30 Nov 2010)
New Revision: 18890

Modified:
   branches/rel_2_0/Open-ILS/examples/apache/eg_vhost.conf
Log:
Clean up some of the Apache config mod_rewrite rules

Thomas Berezansky suggested some improvements to the mod_rewrite
rules in eg_vhost.conf on the -devel mailing list; this is a stab
at correcting the most egregious problems.

Tested with Zotero and unAPI still works; tested with the staff
client and language-switching still works, as do the Conify and
Vandelay interfaces. Seems reasonably good.


Modified: branches/rel_2_0/Open-ILS/examples/apache/eg_vhost.conf
===================================================================
--- branches/rel_2_0/Open-ILS/examples/apache/eg_vhost.conf	2010-11-30 21:00:01 UTC (rev 18889)
+++ branches/rel_2_0/Open-ILS/examples/apache/eg_vhost.conf	2010-11-30 21:11:35 UTC (rev 18890)
@@ -59,17 +59,14 @@
 # ----------------------------------------------------------------------------------
 # 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}] [L]
+RewriteRule . - [E=OILS_OPAC_RID:%2,E=OILS_TIME_YEAR:%{TIME_YEAR}]
 
 # ----------------------------------------------------------------------------------
 # Pull the locale from the URL
 # ----------------------------------------------------------------------------------
-RewriteEngine ON
 RewriteCond %{REQUEST_URI} ^/opac/(.*?)/
-RewriteRule - - [E=locale:%1] [L]
+RewriteRule . - [E=locale:%1]
 
 # ----------------------------------------------------------------------------------
 # Configure the OPAC
@@ -203,7 +200,6 @@
     AddType application/xhtml+xml .xml
 </LocationMatch>
 
-RewriteEngine ON
 RewriteCond %{QUERY_STRING} locale=([^&]*)
 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/>
@@ -213,22 +209,19 @@
 # ----------------------------------------------------------------------------------
 # Run server-side XUL and XHTML through xmlent to load the correct XML entities
 # ----------------------------------------------------------------------------------
-RewriteEngine ON
 RewriteCond %{HTTP:Accept-Language} ([a-z]{2}-[A-Z]{2})
 RewriteRule ^/xul/	-	[E=locale:%1]
-RewriteRule ^/reports/	- 	[E=locale:%1] [L]
+RewriteRule ^/reports/	- 	[E=locale:%1]
 
 # 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]
-RewriteRule ^/reports/	- 	[E=locale:en-US] [L]
+RewriteRule ^/reports/	- 	[E=locale:en-US]
 
 # 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]
+RewriteRule . - [E=locale:en-US]
 
 <LocationMatch /xul/.*\.x?html$>
     Options +Includes
@@ -261,7 +254,6 @@
     allow from all
 
     # Force clients to use HTTPS
-    RewriteEngine On
     RewriteCond %{HTTPS} !=on [NC]
     RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [R,L]
 </Location>
@@ -477,7 +469,6 @@
 # ----------------------------------------------------------------------------------
 # Conify - next-generation Evergreen administration interface
 # ----------------------------------------------------------------------------------
-RewriteEngine on
 RewriteRule ^/conify/([a-z]{2}-[A-Z]{2})/global/(.*)$ /conify/global/$2 [E=locale:$1,L]
 <Location /conify>
     Options +Includes
@@ -502,7 +493,6 @@
 # ----------------------------------------------------------------------------------
 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>
@@ -529,7 +519,6 @@
 </Location>
 
 # OpenURL 0.1 searching based on OpenSearch
-RewriteEngine on
 RewriteMap openurl prg:/openils/bin/openurl_map.pl
 RewriteCond %{QUERY_STRING} (^.*$)
 RewriteRule ^/openurl$ ${openurl:%1} [NE,PT]



More information about the open-ils-commits mailing list