in reply to setting up a perl module to replace Apache's autoindex

If I understood correctly, you want Drall to be called with the current location whenever a file index.html isn't found. You can do as follow.

Replace the redirect to Drall with a call to a printenv script:

DirectoryIndex index.html /cgi-bin/printenv.pl

This way, whenever you visit a location without index.html, you get redirected to the script. If now you look at what printenv.pl says, you will see many headers prefixed by REDIRECT_, and the uri you were looking for is in REDIRECT_REQUEST_URI.

So, the solution is to substitute printenv.pl with a script which issues a redirect to Drall with the correct paramaters, something like

use CGI; $redir = '/cgi-bin/drall.pl?left='. $ENV{REDIRECT_REQUEST_URI}; print CGI::redirect(-uri => $redir);

Hope this helps! Ciao, Valerio

Replies are listed 'Best First'.
thanks valdez
by khopesh (Initiate) on Aug 01, 2002 at 14:21 UTC
    (I am original poster, damn cookies screwed up)
    that is EXACTLY what I needed, and thanks for explaining it; there was no REDIRECT_REQUEST_URI, but there is a REDIRECT_URL as well as a REQUEST_URI, both seem to be the same, so I am happy using REDIRECT_URL.
    (perl 5.6.1, apache 1.3.26, solaris 2.6, no mod_perl(?))

    Thanks again,
    -k

      You are welcome :) Assuming you are working under some kind of unix, you can use this command to discover what kind of HTTP server is used:

      lynx -mime_header http://www.perl.com | grep -E "^Server: "

      Ciao, Valerio