mod_dir.html revision 1e895b30bf4833c928334fad80fac8be169ab877
3421N/A<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
3421N/A<HTML>
3421N/A<HEAD>
3421N/A<TITLE>Apache module mod_dir</TITLE>
3421N/A</HEAD>
3421N/A
3421N/A<!-- Background white, links blue (unvisited), navy (visited), red (active) -->
3421N/A<BODY
3421N/A BGCOLOR="#FFFFFF"
3421N/A TEXT="#000000"
3421N/A LINK="#0000FF"
3421N/A VLINK="#000080"
3421N/A ALINK="#FF0000"
3421N/A>
3421N/A<!--#include virtual="header.html" -->
3421N/A<H1 ALIGN="CENTER">Module mod_dir</H1>
3421N/A
3421N/AThis module is contained in the <code>mod_dir.c</code> file, and
3421N/Ais compiled in by default. It provides for directory indexing.
3421N/A
3421N/A<h2>Summary</h2>
3421N/AThis module controls the directory indexing. The index of a directory
3421N/Acan come from one of two sources:
3421N/A<ul>
3421N/A<li>A file written by the user, typically called <code>index.html</code>.
3421N/AThe <A HREF="#directoryindex">DirectoryIndex</A> directive sets the name
3421N/Aof this file.
3421N/A<li>Otherwise, a listing generated by the server. The other directives
3421N/Acontrol the format of this listing. The <A HREF="#addicon">AddIcon</A>,
3421N/A<A HREF="#addiconbyencoding">AddIconByEncoding</A> and
3421N/A<A HREF="#addiconbytype">AddIconByType</A> are used to set a list of
3421N/Aicons to display for various file types; for each file listed, the
3421N/Afirst icon listed that matches the file is displayed.
3421N/A</ul>
3421N/A
3421N/A
3421N/A<h2>Directives</h2>
3421N/A
3421N/A<menu>
3421N/A<li><A HREF="#addalt">AddAlt</A>
3421N/A<li><A HREF="#addaltbyencoding">AddAltByEncoding</A>
3421N/A<li><A HREF="#addaltbytype">AddAltByType</A>
3421N/A<li><A HREF="#adddescription">AddDescription</A>
3421N/A<li><A HREF="#addicon">AddIcon</A>
3421N/A<li><A HREF="#addiconbyencoding">AddIconByEncoding</A>
3421N/A<li><A HREF="#addiconbytype">AddIconByType</A>
3421N/A<li><A HREF="#defaulticon">DefaultIcon</A>
3421N/A<li><A HREF="#directoryindex">DirectoryIndex</A>
3421N/A<li><A HREF="#fancyindexing">FancyIndexing</A>
3421N/A<li><A HREF="#headername">HeaderName</A>
3421N/A<li><A HREF="#indexignore">IndexIgnore</A>
3421N/A<li><A HREF="#indexoptions">IndexOptions</A>
3421N/A<li><A HREF="#readmename">ReadmeName</A>
3421N/A</menu>
3421N/A<hr>
3421N/A
3421N/A<A name="addalt"><h2>AddAlt</h2></A>
3421N/A<!--%plaintext &lt;?INDEX {\tt AddAlt} directive&gt; -->
3421N/A<strong>Syntax:</strong> AddAlt <em>string file file...</em><br>
3421N/A<Strong>Context:</strong> server config, virtual host, directory, .htaccess<br>
3421N/A<Strong>Override:</strong> Indexes<br>
3421N/A<strong>Status:</strong> Base<br>
3421N/A<strong>Module:</strong> mod_dir<p>
3421N/A
3421N/AThis sets the alternate text to display for a file, instead of an icon, for
3421N/A<A HREF="#fancyindexing">FancyIndexing</A>. <em>File</em> is a file
3421N/Aextension, partial filename, wild-card expression or full filename for files
3421N/Ato describe. <em>String</em> is enclosed in double quotes
3421N/A(<code>&quot;</code>). This alternate text is displayed if the client is
3421N/Aimage-incapable or has image loading disabled.
3421N/A
3421N/A<HR>
3421N/A<A name="addaltbyencoding"><h2>AddAltByEncoding</h2></A>
3421N/A<!--%plaintext &lt;?INDEX {\tt AddAltByEncoding} directive&gt; -->
3421N/A<strong>Syntax:</strong> AddAltByEncoding <em>string MIME-encoding
3421N/A MIME-encoding...</em><br>
3421N/A<Strong>Context:</strong> server config, virtual host, directory, .htaccess<br>
3421N/A<Strong>Override:</strong> Indexes<br>
3421N/A<strong>Status:</strong> Base<br>
3421N/A<strong>Module:</strong> mod_dir<p>
3421N/A
3421N/AThis sets the alternate text to display for a file, instead of an icon, for
3421N/A<A HREF="#fancyindexing">FancyIndexing</A>. <em>MIME-encoding</em> is a
3421N/Avalid content-encoding, such as <SAMP>x-compress</SAMP>.
3421N/A<em>String</em> is enclosed in double quotes
3421N/A(<code>&quot;</code>). This alternate text is displayed if the client is
3421N/Aimage-incapable or has image loading disabled.
3421N/A
3421N/A<HR>
3421N/A<A name="addaltbytype"><h2>AddAltByType</h2></A>
3421N/A<!--%plaintext &lt;?INDEX {\tt AddAltByType} directive&gt; -->
3421N/A<strong>Syntax:</strong> AddAltByType <em>string MIME-type MIME-type...</em><br>
3421N/A<Strong>Context:</strong> server config, virtual host, directory, .htaccess<br>
3421N/A<Strong>Override:</strong> Indexes<br>
3421N/A<strong>Status:</strong> Base<br>
3421N/A<strong>Module:</strong> mod_dir<p>
3421N/A
3421N/AThis sets the alternate text to display for a file, instead of an icon, for
3421N/A<A HREF="#fancyindexing">FancyIndexing</A>. <em>MIME-type</em> is a
3421N/Avalid content-type, such as <SAMP>text/html</SAMP>.
3421N/A<em>String</em> is enclosed in double quotes
3421N/A(<code>&quot;</code>). This alternate text is displayed if the client is
3421N/Aimage-incapable or has image loading disabled.
3421N/A
3421N/A<HR>
3421N/A
3421N/A<A name="adddescription"><h2>AddDescription</h2></A>
3421N/A<!--%plaintext &lt;?INDEX {\tt AddDescription} directive&gt; -->
3421N/A<strong>Syntax:</strong> AddDescription <em>string file file...</em><br>
3421N/A<Strong>Context:</strong> server config, virtual host, directory, .htaccess<br>
3421N/A<Strong>Override:</strong> Indexes<br>
3421N/A<strong>Status:</strong> Base<br>
3421N/A<strong>Module:</strong> mod_dir<p>
3421N/A
3421N/AThis sets the description to display for a file, for
3421N/A<A HREF="#fancyindexing">FancyIndexing</A>. <em>File</em> is a file
3421N/Aextension, partial filename, wild-card expression or full filename for files
3421N/Ato describe. <em>String</em> is enclosed in double quotes
3421N/A(<code>&quot;</code>). Example:
3421N/A<blockquote><code>AddDescription "The planet Mars" /web/pics/mars.gif
3421N/A</code></blockquote><p><hr>
3421N/A
3421N/A<A name="addicon"><h2>AddIcon</h2></A>
3421N/A<!--%plaintext &lt;?INDEX {\tt AddIcon} directive&gt; -->
3421N/A<strong>Syntax:</strong> AddIcon <em>icon name name ...</em><br>
3421N/A<Strong>Context:</strong> server config, virtual host, directory, .htaccess<br>
3421N/A<Strong>Override:</strong> Indexes<br>
3421N/A<strong>Status:</strong> Base<br>
3421N/A<strong>Module:</strong> mod_dir<p>
3421N/A
3421N/AThis sets the icon to display next to a file ending in <em>name</em> for
3421N/A<A HREF="#fancyindexing">FancyIndexing</A>. <em>Icon</em> is either a
3421N/A(%-escaped) relative URL to the icon, or of the format
3421N/A(<em>alttext</em>,<em>url</em>) where <em>alttext</em> is the text tag given
3421N/Afor an icon for non-graphical browsers.<p>
3421N/A
3421N/A<em>Name</em> is either ^^DIRECTORY^^ for directories, ^^BLANKICON^^ for
3421N/Ablank lines (to format the list correctly), a file extension, a wildcard
3421N/Aexpression, a partial filename or a complete filename. Examples:
3421N/A<blockquote><code>
3421N/AAddIcon (IMG,/icons/image.xbm) .gif .jpg .xbm <br>
3421N/AAddIcon /icons/dir.xbm ^^DIRECTORY^^ <br>
3421N/AAddIcon /icons/backup.xbm *~
3421N/A</code></blockquote>
3421N/A<A HREF="#addiconbytype">AddIconByType</A> should be used in preference to
3421N/AAddIcon, when possible.<p><hr>
3421N/A
3421N/A<A name="addiconbyencoding"><h2>AddIconByEncoding</h2></A>
3421N/A<!--%plaintext &lt;?INDEX {\tt AddIconByEncoding} directive&gt; -->
3421N/A<strong>Syntax:</strong> AddIconByEncoding <em>icon mime-encoding mime-encoding
3421N/A...</em><br>
3421N/A<Strong>Context:</strong> server config, virtual host, directory, .htaccess<br>
3421N/A<Strong>Override:</strong> Indexes<br>
3421N/A<strong>Status:</strong> Base<br>
3421N/A<strong>Module:</strong> mod_dir<p>
3421N/A
3421N/AThis sets the icon to display next to files with
3421N/A<em>mime-encoding</em> for <A HREF="#fancyindexing">FancyIndexing</A>.
3421N/A<em>Icon</em> is either a (%-escaped) relative URL to the icon, or of the
3421N/Aformat (<em>alttext</em>,<em>url</em>) where <em>alttext</em> is the text tag
3421N/Agiven for an icon for non-graphical browsers.<p>
3421N/A
3421N/A<em>Mime-encoding</em> is a wildcard expression matching required the
3421N/Acontent-encoding. Examples:
3421N/A<blockquote><code>
3421N/AAddIconByEncoding /icons/compress.xbm x-compress
3421N/A</code></blockquote><p><hr>
3421N/A
3421N/A<A name="addiconbytype"><h2>AddIconByType</h2></A>
3421N/A<!--%plaintext &lt;?INDEX {\tt AddIconByType} directive&gt; -->
3421N/A<strong>Syntax:</strong> AddIconByType <em>icon mime-type mime-type ...</em><br>
3421N/A<Strong>Context:</strong> server config, virtual host, directory, .htaccess<br>
3421N/A<Strong>Override:</strong> Indexes<br>
3421N/A<strong>Status:</strong> Base<br>
3421N/A<strong>Module:</strong> mod_dir<p>
3421N/A
3421N/AThis sets the icon to display next to files of type <em>mime-type</em> for
3421N/A<A HREF="#fancyindexing">FancyIndexing</A>. <em>Icon</em> is either a
3421N/A(%-escaped) relative URL to the icon, or of the format
3421N/A(<em>alttext</em>,<em>url</em>) where <em>alttext</em> is the text tag given
3421N/Afor an icon for non-graphical browsers.<p>
3421N/A<em>Mime-type</em> is a wildcard expression matching required the mime types.
3421N/AExamples:
3421N/A<blockquote><code>
3421N/AAddIconByType (IMG,/icons/image.xbm) image/*
3421N/A</code></blockquote><p><hr>
3421N/A
3421N/A<A name="defaulticon"><h2>DefaultIcon</h2></A>
3421N/A<!--%plaintext &lt;?INDEX {\tt DefaultIcon} directive&gt; -->
3421N/A<strong>Syntax:</strong> DefaultIcon <em>url</em><br>
3421N/A<Strong>Context:</strong> server config, virtual host, directory, .htaccess<br>
3421N/A<Strong>Override:</strong> Indexes<br>
3421N/A<strong>Status:</strong> Base<br>
3421N/A<strong>Module:</strong> mod_dir<p>
3421N/A
3421N/AThe DefaultIcon directive sets the icon to display for files when no
3421N/Aspecific icon is known, for <A HREF="#fancyindexing">FancyIndexing</A>.
3421N/A<em>Url</em> is a (%-escaped) relative URL to the icon. Examples:
3421N/A<blockquote><code>
3421N/ADefaultIcon /icon/unknown.xbm
3421N/A</code></blockquote><p><hr>
3421N/A
3421N/A<A name="directoryindex"><h2>DirectoryIndex</h2></A>
3421N/A<!--%plaintext &lt;?INDEX {\tt DirectoryIndex} directive&gt; -->
3421N/A<strong>Syntax:</strong> DirectoryIndex <em>local-url local-url ...</em><br>
3421N/A<strong>Default:</strong> <code>DirectoryIndex index.html</code><br>
3421N/A<Strong>Context:</strong> server config, virtual host, directory, .htaccess<br>
3421N/A<Strong>Override:</strong> Indexes<br>
3421N/A<strong>Status:</strong> Base<br>
3421N/A<strong>Module:</strong> mod_dir<p>
3421N/A
3421N/AThe DirectoryIndex directive sets the list of resources to look for,
3421N/Awhen the client requests an index of the directory by specifying a /
3421N/Aat the end of the a directory name. <em>Local-url</em> is the
3421N/A(%-encoded) URL of a document on the server relative to the requested
3421N/Adirectory; it is usually the name of a file in the directory. Several
3421N/AURLs may be given, in which case the server will return the first one
3421N/Athat it finds. If none of the resources exist and the
3421N/A<CODE>Indexes</CODE> option is set, the server will generate its own
3421N/Alisting of the directory.
3421N/A<P>
3421N/A
3421N/AExample:
3421N/A<blockquote><code>
3421N/ADirectoryIndex index.html
3421N/A</code></blockquote>
3421N/Athen a request for <code>http://myserver/docs/</code> would return
3421N/A<code>http://myserver/docs/index.html</code> if it exists, or would list
3421N/Athe directory if it did not. <p>
3421N/A
3421N/ANote that the documents do not need to be relative to the directory;
3421N/A<blockquote><code>
3421N/ADirectoryIndex index.html index.txt /cgi-bin/index.pl</code></blockquote>
3421N/Awould cause the CGI script <code>/cgi-bin/index.pl</code> to be executed
3421N/Aif neither <code>index.html</code> or <code>index.txt</code> existed in
3421N/Aa directory.<p><hr>
3421N/A
3421N/A<A name="fancyindexing"><h2>FancyIndexing</h2></A>
3421N/A<!--%plaintext &lt;?INDEX {\tt FancyIndexing} directive&gt; -->
3421N/A<strong>Syntax:</strong> FancyIndexing <em>boolean</em><br>
3421N/A<Strong>Context:</strong> server config, virtual host, directory, .htaccess<br>
3421N/A<Strong>Override:</strong> Indexes<br>
3421N/A<strong>Status:</strong> Base<br>
3421N/A<strong>Module:</strong> mod_dir<p>
3421N/A
3421N/AThe FancyIndexing directive sets the FancyIndexing option for a directory.
3421N/A<em>Boolean</em> can be <code>on</code> or <code>off</code>. The
3421N/A<A HREF="#indexoptions">IndexOptions</A> directive should be used in
3421N/Apreference.<p><hr>
3421N/A
3421N/A<A name="headername"><h2>HeaderName</h2></A>
3421N/A<!--%plaintext &lt;?INDEX {\tt HeaderName} directive&gt; -->
3421N/A<strong>Syntax:</strong> HeaderName <em>filename</em><br>
3421N/A<Strong>Context:</strong> server config, virtual host, directory, .htaccess<br>
3421N/A<Strong>Override:</strong> Indexes<br>
3421N/A<strong>Status:</strong> Base<br>
3421N/A<strong>Module:</strong> mod_dir<p>
3421N/A
3421N/AThe HeaderName directive sets the name of the file that will be inserted
3421N/Aat the top of the index listing. <em>Filename</em> is the name of the file
3421N/Ato include, and is taken to be relative to the directory being indexed.
3421N/AThe server first attempts to include <em>filename</em><code>.html</code>
3421N/Aas an HTML document, otherwise it will include <em>filename</em> as plain
3421N/Atext. Example:
3421N/A<blockquote><code>HeaderName HEADER</code></blockquote>
3421N/Awhen indexing the directory <code>/web</code>, the server will first look for
3421N/Athe HTML file <code>/web/HEADER.html</code> and include it if found, otherwise
3421N/Ait will include the plain text file <code>/web/HEADER</code>, if it exists.
3421N/A
3421N/A<p>See also <A HREF="#readmename">ReadmeName</A>.<p><hr>
3421N/A
3421N/A<A name="indexignore"><h2>IndexIgnore</h2></A>
3421N/A<!--%plaintext &lt;?INDEX {\tt IndexIgnore} directive&gt; -->
3421N/A<strong>Syntax:</strong> IndexIgnore <em>file file ...</em><br>
3421N/A<Strong>Context:</strong> server config, virtual host, directory, .htaccess<br>
3421N/A<Strong>Override:</strong> Indexes<br>
3421N/A<strong>Status:</strong> Base<br>
3421N/A<strong>Module:</strong> mod_dir<p>
3421N/A
3421N/AThe IndexIgnore directive adds to the list of files to hide when listing
3421N/Aa directory. <em>File</em> is a file extension, partial filename,
3421N/Awildcard expression or full filename for files to ignore. Multiple
3421N/AIndexIgnore directives add to the list, rather than the replacing the list
3421N/Aof ignored files. By default, the list contains `<code>.</code>'. Example:
3421N/A<blockquote><code>
3421N/AIndexIgnore README .htaccess *~
3421N/A</code></blockquote><p><hr>
3421N/A
3421N/A<A name="indexoptions"><h2>IndexOptions</h2></A>
3421N/A<!--%plaintext &lt;?INDEX {\tt IndexOptions} directive&gt; -->
3421N/A<strong>Syntax:</strong> IndexOptions <em>option option ...</em><br>
3421N/A<Strong>Context:</strong> server config, virtual host, directory, .htaccess<br>
3421N/A<Strong>Override:</strong> Indexes<br>
3421N/A<strong>Status:</strong> Base<br>
3421N/A<strong>Module:</strong> mod_dir<p>
3421N/A
3421N/AThe IndexOptions directive specifies the behavior of the directory indexing.
3421N/A<em>Option</em> can be one of
3421N/A<dl>
3421N/A<dt>FancyIndexing
3421N/A<dd><!--%plaintext &lt;?INDEX {\tt FancyIndexing} index option&gt; -->
3421N/AThis turns on fancy indexing of directories.
3421N/A<dt>IconsAreLinks
3421N/A<dd>
3421N/A<!--%plaintext &lt;?INDEX {\tt IconsAreLinks} index option&gt; -->
3421N/AThis makes the icons part of the anchor for the filename, for
3421N/Afancy indexing.
3421N/A<dt>ScanHTMLTitles
3421N/A<dd><!--%plaintext &lt;?INDEX {\tt ScanHTMLTitles} index option&gt; -->
3421N/AThis enables the extraction of the title from HTML documents for fancy
3421N/Aindexing. If the file does not have a description given by
3421N/A<A HREF="#adddescription">AddDescription</A> then httpd will read the
3421N/Adocument for the value of the TITLE tag. This is CPU and disk intensive.
3421N/A<dt>SuppressLastModified
3421N/A<dd>
3421N/A<!--%plaintext &lt;?INDEX {\tt SuppressLastModified} index option&gt; -->
3421N/AThis will suppress the display of the last modification date, in fancy
3421N/Aindexing listings.
3421N/A<dt>SuppressSize
3421N/A<dd>
3421N/A<!--%plaintext &lt;?INDEX {\tt SuppressSize} index option&gt; -->
3421N/AThis will suppress the file size in fancy indexing listings.
3421N/A<dt>SuppressDescription
3421N/A<dd>
3421N/A<!--%plaintext &lt;?INDEX {\tt SuppressDescription} index option&gt; -->
3421N/AThis will suppress the file description in fancy indexing listings.
3421N/A</dl>
3421N/AThis default is that no options are enabled. If multiple IndexOptions
3421N/Acould apply to a directory, then the most specific one is taken complete;
3421N/Athe options are not merged. For example:
3421N/A<blockquote><code>
3421N/A&lt;Directory /web/docs&gt; <br>
3421N/AIndexOptions FancyIndexing <br>
3421N/A&lt;/Directory&gt;<br>
3421N/A&lt;Directory /web/docs/spec&gt; <br>
3421N/AIndexOptions ScanHTMLTitles <br>
3421N/A&lt;/Directory&gt;
3421N/A</code></blockquote>
3421N/Athen only <code>ScanHTMLTitles</code> will be set for the /web/docs/spec
3421N/Adirectory.<p><hr>
3421N/A
3421N/A<A name="readmename"><h2>ReadmeName</h2></A>
3421N/A<!--%plaintext &lt;?INDEX {\tt ReadmeName} directive&gt; -->
3421N/A<strong>Syntax:</strong> ReadmeName <em>filename</em><br>
3421N/A<Strong>Context:</strong> server config, virtual host, directory, .htaccess<br>
3421N/A<Strong>Override:</strong> Indexes<br>
3421N/A<strong>Status:</strong> Base<br>
3421N/A<strong>Module:</strong> mod_dir<p>
3421N/A
3421N/AThe ReadmeName directive sets the name of the file that will be appended
3421N/Ato the end of the index listing. <em>Filename</em> is the name of the file
3421N/Ato include, and is taken to be relative to the directory being indexed.
3421N/AThe server first attempts to include <em>filename</em><code>.html</code>
3421N/Aas an HTML document, otherwise it will include <em>filename</em> as plain
3421N/Atext. Example:
3421N/A<blockquote><code>ReadmeName README</code></blockquote>
3421N/Awhen indexing the directory <code>/web</code>, the server will first look for
3421N/Athe HTML file <code>/web/README.html</code> and include it if found, otherwise
3421N/Ait will include the plain text file <code>/web/README</code>, if it exists.
3421N/A
3421N/A<p>See also <A HREF="#headername">HeaderName</A>.<p>
3421N/A
3421N/A
3421N/A<!--#include virtual="footer.html" -->
3421N/A</BODY>
3421N/A</HTML>
3421N/A
3421N/A