I'm using Apache 1.3.6.
I've got a CGI [call it /long/complex/path/script.cgi] which makes use of
pathinfo stuff in the URL at runtime. For example,
"...script.cgi/pathinfostuff.here" or "...script.cgi/other.stuff" might be
valid URLs.
I use a ScriptAlias directive to make the script accessible and run as a
CGI:
ScriptAlias /shortpath /long/complex/path
Now Apache will run scripts under this directory correctly when users go to
URL http://host.name/shortpath/script.cgi/whatever. So far so good.
The problem is that I want to require authentication using AuthName,
AuthType and require valid-user. I can't get this last bit to work
correctly, either with
<Directorymatch "/long/complex/path/script.cgi/privatestuff.*">
AuthName "foo"
AuthType "basic"
require valid-user
OurAuthFn on
</DirectoryMatch>
or with
<DirectoryMatch "/shortpath/path.cgi/privatestuff.*">
AuthName "foo"
AuthType "basic"
require valid-user
OurAuthFn on
</DirectoryMatch>
Note that "...script.cgi/privatestuff.*" should require authentication, but
"...script.cgi/publicstuff.*" should not. How do I do this with Apache?
Under Netscape 3.5.1, I used NameTrans with basically the same args as
ScriptAlias (above), then a PathCheck inside
"/long/copmlex/path/script.cgi/pathinfostuff.*"
This is the really tricky part. It's not good enough to require auth for
all invocations of the script itself (I can do that easily). Depending on
the rest of the path info, after the script.cgi, authentication may or may
not be required.
Suggestions greatly appreciated.
--
Phil Tracy
Northwestern University, Evanston, IL. USA