<LocationMatch /eg/staff/>
Options -MultiViews
+ PerlSetVar OILSWebStopAtIndex "true"
# map /eg/staff to /eg/staff/index
RewriteEngine On
RewriteCond %{PATH_INFO} =/staff/
RewriteRule (.*) /eg/staff/index [L,DPI]
- # map /eg/staff/foo/bar to /eg/staff/foo/index
- RewriteEngine On
- RewriteCond %{PATH_INFO} !.*/(index|css|t_*)
- RewriteRule (.*)/[^\/]+$ $1/index [L,DPI]
-
<IfModule mod_headers.c>
Header append Cache-Control "public"
</IFModule>
<LocationMatch /eg/staff/>
Options -MultiViews
+ PerlSetVar OILSWebStopAtIndex "true"
# map /eg/staff to /eg/staff/index
RewriteEngine On
RewriteCond %{PATH_INFO} =/staff/
RewriteRule (.*) /eg/staff/index [L,DPI]
- # map /eg/staff/foo/bar to /eg/staff/foo/index
- RewriteEngine On
- RewriteCond %{PATH_INFO} !.*/(index|css|t_*)
- RewriteRule (.*)/[^\/]+$ $1/index [L,DPI]
-
<IfModule mod_headers.c>
Header append Cache-Control "public"
</IFModule>
my $page_args = [];
my $as_xml = $r->dir_config('OILSWebForceValidXML');
my $ext = $r->dir_config('OILSWebDefaultTemplateExtension');
+ my $at_index = $r->dir_config('OILSWebStopAtIndex');
my @parts = split('/', $path);
my $localpath = $path;
if(-r $fpath) {
$template = "$localpath.$ext";
last;
+ }
+ }
+ last if $template;
+
+ if ($at_index) {
+ # no matching template was found in the current directory.
+ # stop-at-index requested; see if there is an index.ext
+ # file in the same directory instead.
+ for my $tpath (@{$ctx->{template_paths}}) {
+ # replace the final path component with 'index'
+ $localpath =~ s|/[^/]+$|/index|;
+ my $fpath = "$tpath/$localpath.$ext";
+ $r->log->debug("egweb: looking at possible template $fpath");
+ if (-r $fpath) {
+ $template = "$localpath.$ext";
+ last;
+ }
}
}
last if $template;
+
push(@args, pop @parts);
$localpath = join('/', @parts);
}