DirectoryIndex directive

Top - Docs - General - Server - Resource - Access - FAQ - Tutorials

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(s) HTTPd should look for as a prewritten index to a given directory.


Syntax

DirectoryIndex file

Where file is a file name.

Only one DirectoryIndex directive is allowed in the server configuration file.

Note that under HTTPd 1.5 and above, multiple filenames may be specified for the DirectoryIndex directive. The file that matches the leftmost filespec will be used for the index.


File

srm.conf

Default

If you do not specify a DirectoryIndex, HTTPd assumes:

DirectoryIndex index.html


Example

DirectoryIndex .index.html

This would set DirectoryIndex to .index.html. 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 create and return an index from the filesystem.


[Back] Return to Resource Configuration File Overview
NCSA HTTPd Development Team / httpd@ncsa.uiuc.edu / Last Modified 7-12-95