ScriptAliasMatch vs. DirectoryIndex problem

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 ...


Go Back   Usenet Forums > Web Server and Related Forums > Apache Web Server

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 11-07-2007
František Fuka
 
Posts: n/a
Default ScriptAliasMatch vs. DirectoryIndex problem

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?

  #2 (permalink)  
Old 11-07-2007
František Fuka
 
Posts: n/a
Default Re: ScriptAliasMatch vs. DirectoryIndex problem

On Nov 7, 11:25 am, František Fuka <fux...@gmail.com> wrote:

> ScriptAliasMatch ^(.*html)$ /home/fuxoft/fuxoft.cz/fftempl/fftempl.cgi?page=$1


Oops, I wrote that wrong. That's "htm", not "html", of course.

  #3 (permalink)  
Old 11-07-2007
D. Stussy
 
Posts: n/a
Default Re: ScriptAliasMatch vs. DirectoryIndex problem

"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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 01:23 AM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0