(function(a,e,f,g,b,c,d){a.GoogleAnalyticsObject=b;a[b]=a[b]||function(){(a[b].q=a[b].q||[]).push(arguments)};a[b].l=1*new Date;c=e.createElement(f);d=e.getElementsByTagName(f)[0];c.async=1;c.src=g;d.parentNode.insertBefore(c,d)})(window,document,"script","https://www.google-analytics.com/analytics.js","ga");ga("create","UA-732153-7","auto",{allowLinker:!0,siteSpeedSampleRate:10});ga("set","transport","beacon");ga("set","anonymizeIp",!0);ga("require","linker"); ga("linker:autoLink","askapache.com askapache.net htaccess.io htaccesselite.com askapache.info htaccess.guru".split(" "),!0);ga("send","pageview"); vlink="#000080" alink="#FF0000">

Apache HTTP Server Version 1.3

Is this the version you want? For more recent versions, check our documentation index.

Module mod_dir

This module provides for "trailing slash" redirects and serving directory index files.

Status: Base
Source File: mod_dir.c
Module Identifier: dir_module


The index of a directory can come from one of two sources: The two functions are separated so that you can completely remove (or replace) automatic index generation should you want to.

A "trailing slash" redirect is issued when the server receives a request for a URL http://servername/foo/dirname where dirname is a directory. Directories require a trailing slash, so mod_dir issues a redirect to http://servername/foo/dirname/.


DirectoryIndex directive

Syntax: DirectoryIndex local-url [local-url] ...
Default: DirectoryIndex index.html
Context: server config, virtual host, directory, .htaccess
Override: Indexes
Status: Base
Module: mod_dir

The DirectoryIndex directive sets the list of resources to look for, when the client requests an index of the directory by specifying a / at the end of the a directory name. Local-url is the (%-encoded) URL of a document on the server relative to the requested directory; it is usually the name of a file in the directory. Several URLs may be given, in which case the server will return the first one that it finds. If none of the resources exist and the Indexes option is set, the server will generate its own listing of the directory.


DirectoryIndex index.html
then a request for http://myserver/docs/ would return http://myserver/docs/index.html if it exists, or would list the directory if it did not.

Note that the documents do not need to be relative to the directory;

DirectoryIndex index.html index.txt /cgi-bin/index.pl
would cause the CGI script /cgi-bin/index.pl to be executed if neither index.html or index.txt existed in a directory.

Apache HTTP Server Version 1.3

Index Home