web staff : egweb stop-at-index supports /-ended paths
authorBill Erickson <berick@esilibrary.com>
Thu, 12 Dec 2013 16:48:39 +0000 (11:48 -0500)
committerBill Erickson <berick@esilibrary.com>
Thu, 12 Dec 2013 16:48:39 +0000 (11:48 -0500)
Signed-off-by: Bill Erickson <berick@esilibrary.com>
Open-ILS/examples/apache/eg_vhost.conf.in
Open-ILS/examples/apache_24/eg_vhost.conf.in
Open-ILS/src/perlmods/lib/OpenILS/WWW/EGWeb.pm

index 5305d0b..a99d9ce 100644 (file)
@@ -791,11 +791,6 @@ RewriteRule ^/openurl$ ${openurl:%1} [NE,PT]
     Options -MultiViews
     PerlSetVar OILSWebStopAtIndex "true"
 
-    # map /eg/staff to /eg/staff/index
-    RewriteEngine On
-    RewriteCond %{PATH_INFO} =/staff/
-    RewriteRule (.*) /eg/staff/index [L,DPI]
-
     <IfModule mod_headers.c>
         Header append Cache-Control "public"
     </IFModule>
index dfdeb55..c94ef54 100644 (file)
@@ -803,11 +803,6 @@ RewriteRule ^/openurl$ ${openurl:%1} [NE,PT]
     Options -MultiViews
     PerlSetVar OILSWebStopAtIndex "true"
 
-    # map /eg/staff to /eg/staff/index
-    RewriteEngine On
-    RewriteCond %{PATH_INFO} =/staff/
-    RewriteRule (.*) /eg/staff/index [L,DPI]
-
     <IfModule mod_headers.c>
         Header append Cache-Control "public"
     </IFModule>
index 4d00a3f..c952a0b 100644 (file)
@@ -264,7 +264,11 @@ sub find_template {
             # file in the same directory instead.
             for my $tpath (@{$ctx->{template_paths}}) {
                 # replace the final path component with 'index'
-                $localpath =~ s|/[^/]+$|/index|;
+                if ($localpath =~ m|/$|) {
+                    $localpath .= 'index';
+                } else {
+                    $localpath =~ s|/[^/]+$|/index|;
+                }
                 my $fpath = "$tpath/$localpath.$ext";
                 $r->log->debug("egweb: looking at possible template $fpath");
                 if (-r $fpath) {