httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Warhurst, SI (Spencer) " <>
Subject RE: [users@httpd] Directory listing
Date Fri, 20 Dec 2002 11:23:56 GMT
> headername /cgi-bin/header.cgi
> addtype text/html;charset=iso-8859-1 .cgi
> header.cgi:
> #! /bin/perl -w
> use strict;
> my $here = $ENV{'REQUEST_URI'};
> $here =~ s:/$::;
> print "Content-type: text/html;charset=iso-8859-1\n"
>     . "\n"
>     . "<html>\n"
>     . " <head>\n"
>     . "  <title>Index of $here</title>\n"
>     . " </head>\n"
>     . " <body>\n"
>     . "  <h1>Index of $here</h1>\n";
> exit(0);
> that's just off the top of my head.

Thanks for that.

However, I still can't seem to get it to work though :( It just goes back to
saying "Index of /files/a" like it can't find or process the header file.

I have the following now in my httpd.conf:

<Directory "e:/www/files">
    Options Indexes
    AllowOverride All
    HeaderName "../../cgi-bin/header.cgi"
    AddType text/html;charset=iso-8859-1 .cgi
    ReadmeName "../footer.html"
    IndexOptions DescriptionWidth=75 +SuppressHTMLPreamble

Is that the correct placement of the AddType directive?

On a side note, having to specify relative paths is a bit of a pain. In this
case the directory being indexed is /files/a but there may be cases where
there's a sub-directory such as /files/a/docs or /files/a/minutes. I just
want every directory under /files (of which there are several thousand) plus
any subdirectories to have the same header & footer but I really dont want
to have to do one of the above <Directory></Directory> structures for all
4000 subdirectories.


The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:> for more info.
To unsubscribe, e-mail:
   "   from the digest:
For additional commands, e-mail:

View raw message