Display Directory in Apache with index.html?

Display Directory in Apache with index.html?

Post by John Reg » Fri, 07 Sep 2001 04:26:42



Apologies in advance if I've overlooked something really obvious, but
I have done a number of searches at groups.Google and apache.org.

Is there a way to display a directory listing when an index.html file
exists? (I'm looking to reproduce the apache behavior of loading the
file system when there is no index.html.) It seems that this must have
already be done in javascript or php, but I can't find _anything_.

I would like to display a sample application that I wrote so that some
others can view it, but the application needs to have an index.html
file. This is for a short class that I'm teaching and I would like the
folks to be able to view the source on-line after the class while
running the application to see how it works.

Thanks,
John

 
 
 

Display Directory in Apache with index.html?

Post by Guente » Fri, 07 Sep 2001 04:56:13


Hi John,
the simplest way may be if you put a .htaccess file into that directory
with the line:
DirectoryIndex foo.htm
as long as you have no foo.htm I assume the server will produce a
listing...
Guenter.

John Regan schrieb:

Quote:> Apologies in advance if I've overlooked something really obvious, but
> I have done a number of searches at groups.Google and apache.org.

> Is there a way to display a directory listing when an index.html file
> exists? (I'm looking to reproduce the apache behavior of loading the
> file system when there is no index.html.) It seems that this must have
> already be done in javascript or php, but I can't find _anything_.

> I would like to display a sample application that I wrote so that some
> others can view it, but the application needs to have an index.html
> file. This is for a short class that I'm teaching and I would like the
> folks to be able to view the source on-line after the class while
> running the application to see how it works.

> Thanks,
> John


 
 
 

Display Directory in Apache with index.html?

Post by David Efflan » Fri, 07 Sep 2001 11:21:10



Quote:> Apologies in advance if I've overlooked something really obvious, but
> I have done a number of searches at groups.Google and apache.org.

> Is there a way to display a directory listing when an index.html file
> exists? (I'm looking to reproduce the apache behavior of loading the
> file system when there is no index.html.) It seems that this must have
> already be done in javascript or php, but I can't find _anything_.

> I would like to display a sample application that I wrote so that some
> others can view it, but the application needs to have an index.html
> file. This is for a short class that I'm teaching and I would like the
> folks to be able to view the source on-line after the class while
> running the application to see how it works.

You could do it with a CGI script.  I normally use it as an index.cgi
(with .cgi added to the DirectoryIndex list) but you could just as easily
call it something else.  It can include HEADER.html before the listing and
README.html as a footer after the listing.  See dirindex.txt in scripts at
either site on last line of sig below.

--
David Efflandt - All spam is ignored - http://www.de-srv.com/
http://www.autox.chicago.il.us/  http://www.berniesfloral.net/
http://cgi-help.virtualave.net/  http://hammer.prohosting.com/~cgi-wiz/

 
 
 

Display Directory in Apache with index.html?

Post by John Reg » Fri, 07 Sep 2001 12:53:13


Excellent suggestion, Guenter. It worked.

Cheers.


> Hi John,
> the simplest way may be if you put a .htaccess file into that directory
> with the line:
> DirectoryIndex foo.htm
> as long as you have no foo.htm I assume the server will produce a
> listing...
> Guenter.

> John Regan schrieb:

> > Apologies in advance if I've overlooked something really obvious, but
> > I have done a number of searches at groups.Google and apache.org.

> > Is there a way to display a directory listing when an index.html file
> > exists? (I'm looking to reproduce the apache behavior of loading the
> > file system when there is no index.html.) It seems that this must have
> > already be done in javascript or php, but I can't find _anything_.

> > I would like to display a sample application that I wrote so that some
> > others can view it, but the application needs to have an index.html
> > file. This is for a short class that I'm teaching and I would like the
> > folks to be able to view the source on-line after the class while
> > running the application to see how it works.

> > Thanks,
> > John

 
 
 

Display Directory in Apache with index.html?

Post by Carl » Wed, 12 Sep 2001 20:44:38


You can also consider a program that generates a file listing,
such as:
http://www.zzee.com/htmlist/index.shtml

Carlos :)


> Apologies in advance if I've overlooked something really obvious, but
> I have done a number of searches at groups.Google and apache.org.

> Is there a way to display a directory listing when an index.html file
> exists? (I'm looking to reproduce the apache behavior of loading the
> file system when there is no index.html.) It seems that this must have
> already be done in javascript or php, but I can't find _anything_.

> I would like to display a sample application that I wrote so that some
> others can view it, but the application needs to have an index.html
> file. This is for a short class that I'm teaching and I would like the
> folks to be able to view the source on-line after the class while
> running the application to see how it works.

> Thanks,
> John