NCSA Server (1.3) and ScriptAlias problems

Kee Hinckley (
Tue, 9 May 1995 16:43:30 +0500

The issue is how to deal with a ScriptAlias that is serving up multiple
HTML files, e.g.:

ScriptAlias /bgc/ /xxx/bgc/access/
ScriptAlias /bgc /xxx/bgc/access/

In particular, the problem is that the script can't tell the difference
between being invoked with or without the trailing slash, and the
difference is quite critical. I suspect that there should be a difference
in PATH_INFO, but there isn't. Is that a bug, or is there another better
way of dealing with this?

1. If you don't have the version with the trailing slash, the (non-trivial
number of) people who hit the site without it will get a file not-found.
This isn't the case when the server is handling access, but it is the case
when you are using a ScriptAlias.

2. If you point them both at the same script, the script can't tell whether
it was invoked with or without the slash (I believe there ought to be a
difference in PATH_INFO, but there isn't).

3. The script can do one of two things when faced with a directory name
with no index.html. It can't do a redirect to the index.html file (which
takes up a fair amount of time, and of course additional server resources),
or it can just server up the file.

4. If it serves up the file, the client will get all the relative links
wrong. It's URL will look like "", it will assume
that "foo" is a file and make all links relative to the link instead of
"foo/". You can try and fix this with a <base href=3D"correcturl"> in the
index.html file, but that doesn't work for all browsers.

5. My solution therefore, is to have a separate script, bound to the
non-slash version of the name, which does nothing but redirect the user to
the correct URL. Ugly, but there it is.


Kee Hinckley Utopia Inc. - Cyberspace Architects=81 617/721-6100

I'm not sure which upsets me more: that people are so unwilling to accept
responsibility for their own actions, or that they are so eager to regulate
everyone else's.