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 file

Where file is a file name.

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


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.


Return to Resource Configuration File Overview

httpd@ncsa.uiuc.edu