This is a discussion on ScriptAliasMatch vs. DirectoryIndex problem within the Apache Web Server forums, part of the Web Server and Related Forums category; Hello there, I run a site on Apache 2 where I use my own simple templating system which uses a ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
Hello 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? |
|
|||
|
"František Fuka" <fuxoft@gmail.com> wrote in message
news:1194431150.695593.128530@k79g2000hse.googlegr oups.com... > ... > Can I do that? If not, can I at least turn off ScriptAliasMatch for > several specific directories? No. Maybe what you want is a rewrite rule.... (One would have a condition that the requested URL not end with a slash.) There may be a more advanced way (using rewriting) to check and see if the target file exists first. |
| Thread Tools | |
| Display Modes | |
|
|