ScriptAliasMatch vs. DirectoryIndex problem
am 07.11.2007 11:25:50 von fuxoftHello there,
I run a site on Apache 2 where I use my own simple templating system
which uses a script to dynamically modify all ".htm" page requests and
leaves everything else as-is.
I have the following in my configuration:
ScriptAliasMatch ^(.*html)$ /home/fuxoft/fuxoft.cz/fftempl/fftempl.cgi?
page=$1
Whenever anyone looks for "mysite.cz/subdir/page.htm", this request
gets passed to my script, which takes the page.htm file from the disk,
modifies it and returns the resulting full HTML to the visitor.
This works great.
I also have "DirectoryIndex index.htm" in my config, so that access
e.g. to "mysite.cz/subdir/" correctly displays "subdir/index.htm" file
(modified by my templating script).
However, problem arises with directories which contain only static
files (images, for example) and I want Apache to display standard
directory listing for them. The problem is that when someone wants to
view "mysite.cz/pictures/", this request is passed to my templating
script even when there is no "index.htm" file inside this directory. I
don't want this and I want the directory listing to be displayed when
there is no index file in the directory...
Can I do that? If not, can I at least turn off ScriptAliasMatch for
several specific directories?