The New DirectoryIndex directive


Purpose

When a client requests a directory, HTTPd can return a pre-written index, or generate one from the filesystem. The DirectoryIndex directive sets the file HTTPd should look for as a prewritten index to a given directory.


Syntax

DirectoryIndex file1 file2 file3

Where file1,file2,file3 are file names.

Only one DirectoryIndex directive is allowed in the server configuration file, but multiple files are allowed on the line. NCSA HTTPd will search for the listed files in order.


File

srm.conf

Default

If you do not specify a DirectoryIndex, HTTPd assumes:

DirectoryIndex index.html index.shtml index.cgi


Example

DirectoryIndex .index.html home.html .index.shtml

A request for /dir/ would cause the server to look for the file DocumentRoot/dir/.index.html. If found, the server would send it back to the client. Otherwise, it would look for DocumentRoot/dir/home.html, and then DocumentRoot/dir/.index.shtml which could be a server side include. If none of these exist, then HTTPd would create and return an index from the filesystem.


NCSA HTTPd Development Team

httpd@ncsa.uiuc.edu