httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Warhurst, SI (Spencer) " <S.I.Warhu...@rl.ac.uk>
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
</Directory>

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.

Spencer

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message