1 <?xml version="1.0" encoding="ISO-8859-1"?>
2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
3 <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"><head><!--
4 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
5 This file is generated from xml source: DO NOT EDIT
6 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
8 <title>mod_autoindex - Apache HTTP Server</title>
9 <link href="../style/css/manual.css" rel="stylesheet" media="all" type="text/css" title="Main stylesheet" />
10 <link href="../style/css/manual-loose-100pc.css" rel="alternate stylesheet" media="all" type="text/css" title="No Sidebar - Default font size" />
11 <link href="../style/css/manual-print.css" rel="stylesheet" media="print" type="text/css" />
12 <link href="../images/favicon.ico" rel="shortcut icon" /></head>
14 <div id="page-header">
15 <p class="menu"><a href="../mod/">Modules</a> | <a href="../mod/directives.html">Directives</a> | <a href="../faq/">FAQ</a> | <a href="../glossary.html">Glossary</a> | <a href="../sitemap.html">Sitemap</a></p>
16 <p class="apache">Apache HTTP Server Version 2.1</p>
17 <img alt="" src="../images/feather.gif" /></div>
18 <div class="up"><a href="./"><img title="<-" alt="<-" src="../images/left.gif" /></a></div>
20 <a href="http://www.apache.org/">Apache</a> > <a href="http://httpd.apache.org/">HTTP Server</a> > <a href="http://httpd.apache.org/docs-project/">Documentation</a> > <a href="../">Version 2.1</a> > <a href="./">Modules</a></div>
21 <div id="page-content">
22 <div id="preamble"><h1>Apache Module mod_autoindex</h1>
23 <table class="module"><tr><th><a href="module-dict.html#Description">Description:</a></th><td>Generates directory indexes,
24 automatically, similar to the Unix <code>ls</code> command or the
25 Win32 <code>dir</code> shell command</td></tr>
26 <tr><th><a href="module-dict.html#Status">Status:</a></th><td>Base</td></tr>
27 <tr><th><a href="module-dict.html#ModuleIdentifier">Module Identifier:</a></th><td>autoindex_module</td></tr>
28 <tr><th><a href="module-dict.html#SourceFile">Source File:</a></th><td>mod_autoindex.c</td></tr></table>
31 <p>The index of a directory can come from one of two
35 <li>A file written by the user, typically called
36 <code>index.html</code>. The <code class="directive"><a href="../mod/mod_dir.html#directoryindex">DirectoryIndex</a></code> directive sets the
37 name of this file. This is controlled by
38 <code class="module"><a href="../mod/mod_dir.html">mod_dir</a></code>.</li>
40 <li>Otherwise, a listing generated by the server. The other
41 directives control the format of this listing. The <code class="directive"><a href="#addicon">AddIcon</a></code>, <code class="directive"><a href="#addiconbyencoding">AddIconByEncoding</a></code> and
42 <code class="directive"><a href="#addiconbytype">AddIconByType</a></code> are
43 used to set a list of icons to display for various file types;
44 for each file listed, the first icon listed that matches the
45 file is displayed. These are controlled by
46 <code class="module"><a href="../mod/mod_autoindex.html">mod_autoindex</a></code>.</li>
48 <p>The two functions are separated so that you can completely
49 remove (or replace) automatic index generation should you want
52 <p>Automatic index generation is enabled with using
53 <code>Options +Indexes</code>. See the
54 <code class="directive"><a href="../mod/core.html#options">Options</a></code> directive for
57 <p>If the <code><a href="#indexoptions:fancyindexing">FancyIndexing</a></code> option is given with the <code class="directive"><a href="#indexoptions">IndexOptions</a></code> directive,
58 the column headers are links that control the order of the
59 display. If you select a header link, the listing will be
60 regenerated, sorted by the values in that column. Selecting the
61 same header repeatedly toggles between ascending and descending
62 order. These column header links are suppressed with
63 <code class="directive"><a href="#indexoptions">IndexOptions</a></code> directive's
64 <code>SuppressColumnSorting</code> option.</p>
66 <p>Note that when the display is sorted by "Size", it's the
67 <em>actual</em> size of the files that's used, not the
68 displayed value - so a 1010-byte file will always be displayed
69 before a 1011-byte file (if in ascending order) even though
70 they both are shown as "1K".</p>
72 <div id="quickview"><h3 class="directives">Directives</h3>
74 <li><img alt="" src="../images/down.gif" /> <a href="#addalt">AddAlt</a></li>
75 <li><img alt="" src="../images/down.gif" /> <a href="#addaltbyencoding">AddAltByEncoding</a></li>
76 <li><img alt="" src="../images/down.gif" /> <a href="#addaltbytype">AddAltByType</a></li>
77 <li><img alt="" src="../images/down.gif" /> <a href="#adddescription">AddDescription</a></li>
78 <li><img alt="" src="../images/down.gif" /> <a href="#addicon">AddIcon</a></li>
79 <li><img alt="" src="../images/down.gif" /> <a href="#addiconbyencoding">AddIconByEncoding</a></li>
80 <li><img alt="" src="../images/down.gif" /> <a href="#addiconbytype">AddIconByType</a></li>
81 <li><img alt="" src="../images/down.gif" /> <a href="#defaulticon">DefaultIcon</a></li>
82 <li><img alt="" src="../images/down.gif" /> <a href="#headername">HeaderName</a></li>
83 <li><img alt="" src="../images/down.gif" /> <a href="#indexignore">IndexIgnore</a></li>
84 <li><img alt="" src="../images/down.gif" /> <a href="#indexoptions">IndexOptions</a></li>
85 <li><img alt="" src="../images/down.gif" /> <a href="#indexorderdefault">IndexOrderDefault</a></li>
86 <li><img alt="" src="../images/down.gif" /> <a href="#readmename">ReadmeName</a></li>
90 <li><img alt="" src="../images/down.gif" /> <a href="#query">Autoindex Request Query Arguments</a></li>
92 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
94 <h2><a name="query" id="query">Autoindex Request Query Arguments</a></h2>
97 <p>Apache 2.0.23 reorganized the Query Arguments for Column
98 Sorting, and introduced an entire group of new query options.
99 To effectively eliminate all client control over the output,
100 the <code><a href="#indexoptions:ignoreclient">IndexOptions
101 IgnoreClient</a></code> option was introduced.</p>
103 <p>The column sorting headers themselves are self-referencing
104 hyperlinks that add the sort query options shown below. Any
105 option below may be added to any request for the directory
109 <li><code>C=N</code> sorts the directory by file name</li>
111 <li><code>C=M</code> sorts the directory by last-modified
112 date, then file name</li>
114 <li><code>C=S</code> sorts the directory by size, then file
117 <li class="separate"><code>C=D</code> sorts the directory by description, then
120 <li><code>O=A</code> sorts the listing in Ascending
123 <li class="separate"><code>O=D</code> sorts the listing in Descending
126 <li><code>F=0</code> formats the listing as a simple list
127 (not FancyIndexed)</li>
129 <li><code>F=1</code> formats the listing as a FancyIndexed
132 <li class="separate"><code>F=2</code> formats the listing as an
133 HTMLTable FancyIndexed list</li>
135 <li><code>V=0</code> disables version sorting</li>
137 <li class="separate"><code>V=1</code> enables version sorting</li>
139 <li><code>P=<var>pattern</var></code> lists only files matching
140 the given <var>pattern</var></li>
143 <p>Note that the 'P'attern query argument is tested
144 <em>after</em> the usual <code class="directive"><a href="#indexignore">IndexIgnore</a></code> directives are processed,
145 and all file names are still subjected to the same criteria as
146 any other autoindex listing. The Query Arguments parser in
147 <code class="module"><a href="../mod/mod_autoindex.html">mod_autoindex</a></code> will stop abruptly when an unrecognized
148 option is encountered. The Query Arguments must be well formed,
149 according to the table above.</p>
151 <p>The simple example below, which can be clipped and saved in
152 a header.html file, illustrates these query options. Note that
153 the unknown "X" argument, for the submit button, is listed last
154 to assure the arguments are all parsed before mod_autoindex
155 encounters the X=Go input.</p>
157 <div class="example"><p><code>
158 <form action="" method="get"><br />
159 <span class="indent">
160 Show me a <select name="F"><br />
161 <span class="indent">
162 <option value="0"> Plain list</option><br />
163 <option value="1" selected="selected"> Fancy list</option><br />
164 <option value="2"> Table list</option><br />
166 </select><br />
167 Sorted by <select name="C"><br />
168 <span class="indent">
169 <option value="N" selected="selected"> Name</option><br />
170 <option value="M"> Date Modified</option><br />
171 <option value="S"> Size</option><br />
172 <option value="D"> Description</option><br />
174 </select><br />
175 <select name="O"><br />
176 <span class="indent">
177 <option value="A" selected="selected"> Ascending</option><br />
178 <option value="D"> Descending</option><br />
180 </select><br />
181 <select name="V"><br />
182 <span class="indent">
183 <option value="0" selected="selected"> in Normal order</option><br />
184 <option value="1"> in Version order</option><br />
186 </select><br />
187 Matching <input type="text" name="P" value="*" /><br />
188 <input type="submit" name="X" value="Go" /><br />
194 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
195 <div class="directive-section"><h2><a name="AddAlt" id="AddAlt">AddAlt</a> <a name="addalt" id="addalt">Directive</a></h2>
196 <table class="directive">
197 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Alternate text to display for a file, instead of an
198 icon selected by filename</td></tr>
199 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>AddAlt <var>string</var> <var>file</var> [<var>file</var>] ...</code></td></tr>
200 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
201 <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>Indexes</td></tr>
202 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Base</td></tr>
203 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_autoindex</td></tr>
205 <p><code class="directive">AddAlt</code> provides the alternate text to
206 display for a file, instead of an icon, for <code><a href="#indexoptions:fancyindexing">FancyIndexing</a></code>.
207 <var>File</var> is a file extension, partial filename, wild-card
208 expression or full filename for files to describe.
209 If <var>String</var> contains any whitespace, you have to enclose it
210 in quotes (<code>"</code> or <code>'</code>). This alternate text
211 is displayed if the client is image-incapable, has image loading
212 disabled, or fails to retrieve the icon.</p>
214 <div class="example"><h3>Examples</h3><p><code>
215 AddAlt "PDF file" *.pdf<br />
216 AddAlt Compressed *.gz *.zip *.Z
220 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
221 <div class="directive-section"><h2><a name="AddAltByEncoding" id="AddAltByEncoding">AddAltByEncoding</a> <a name="addaltbyencoding" id="addaltbyencoding">Directive</a></h2>
222 <table class="directive">
223 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Alternate text to display for a file instead of an icon
224 selected by MIME-encoding</td></tr>
225 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>AddAltByEncoding <var>string</var> <var>MIME-encoding</var>
226 [<var>MIME-encoding</var>] ...</code></td></tr>
227 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
228 <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>Indexes</td></tr>
229 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Base</td></tr>
230 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_autoindex</td></tr>
232 <p><code class="directive">AddAltByEncoding</code> provides the alternate
233 text to display for a file, instead of an icon, for <code><a href="#indexoptions:fancyindexing">FancyIndexing</a></code>.
234 <var>MIME-encoding</var> is a valid content-encoding, such as
235 <code>x-compress</code>. If <var>String</var> contains any whitespace,
236 you have to enclose it in quotes (<code>"</code> or <code>'</code>).
237 This alternate text is displayed if the client is image-incapable,
238 has image loading disabled, or fails to retrieve the icon.</p>
240 <div class="example"><h3>Example</h3><p><code>
241 AddAltByEncoding gzip x-gzip
245 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
246 <div class="directive-section"><h2><a name="AddAltByType" id="AddAltByType">AddAltByType</a> <a name="addaltbytype" id="addaltbytype">Directive</a></h2>
247 <table class="directive">
248 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Alternate text to display for a file, instead of an
249 icon selected by MIME content-type</td></tr>
250 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>AddAltByType <var>string</var> <var>MIME-type</var>
251 [<var>MIME-type</var>] ...</code></td></tr>
252 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
253 <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>Indexes</td></tr>
254 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Base</td></tr>
255 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_autoindex</td></tr>
257 <p><code class="directive">AddAltByType</code> sets the alternate text to
258 display for a file, instead of an icon, for <code><a href="#indexoptions:fancyindexing">FancyIndexing</a></code>.
259 <var>MIME-type</var> is a valid content-type, such as
260 <code>text/html</code>. If <var>String</var> contains any whitespace,
261 you have to enclose it in quotes (<code>"</code> or <code>'</code>).
262 This alternate text is displayed if the client is image-incapable,
263 has image loading disabled, or fails to retrieve the icon.</p>
265 <div class="example"><h3>Example</h3><p><code>
266 AddAltByType 'plain text' text/plain
270 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
271 <div class="directive-section"><h2><a name="AddDescription" id="AddDescription">AddDescription</a> <a name="adddescription" id="adddescription">Directive</a></h2>
272 <table class="directive">
273 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Description to display for a file</td></tr>
274 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>AddDescription <var>string file</var> [<var>file</var>] ...</code></td></tr>
275 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
276 <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>Indexes</td></tr>
277 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Base</td></tr>
278 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_autoindex</td></tr>
280 <p>This sets the description to display for a file, for
281 <code><a href="#indexoptions:fancyindexing">FancyIndexing</a></code>.
282 <var>File</var> is a file extension, partial filename, wild-card
283 expression or full filename for files to describe.
284 <var>String</var> is enclosed in double quotes (<code>"</code>).</p>
286 <div class="example"><h3>Example</h3><p><code>
287 AddDescription "The planet Mars" /web/pics/mars.gif
290 <p>The typical, default description field is 23 bytes wide. 6
291 more bytes are added by the <code><a href="#indexoptions:suppressicon">IndexOptions SuppressIcon</a></code> option, 7 bytes are
292 added by the <code><a href="#indexoptions:suppresssize">IndexOptions SuppressSize</a></code> option, and 19 bytes are
293 added by the <code><a href="#indexoptions:suppresslastmodified">IndexOptions SuppressLastModified</a></code> option.
294 Therefore, the widest default the description column is ever
295 assigned is 55 bytes.</p>
297 <p>See the <a href="#indexoptions:descriptionwidth">DescriptionWidth</a> <code class="directive"><a href="#indexoptions">IndexOptions</a></code> keyword for details on overriding the size
298 of this column, or allowing descriptions of unlimited length.</p>
300 <div class="note"><h3>Caution</h3>
301 <p>Descriptive text defined with <code class="directive">AddDescription</code>
302 may contain HTML markup, such as tags and character entities. If the
303 width of the description column should happen to truncate a tagged
304 element (such as cutting off the end of a bolded phrase), the
305 results may affect the rest of the directory listing.</p>
309 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
310 <div class="directive-section"><h2><a name="AddIcon" id="AddIcon">AddIcon</a> <a name="addicon" id="addicon">Directive</a></h2>
311 <table class="directive">
312 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Icon to display for a file selected by name</td></tr>
313 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>AddIcon <var>icon</var> <var>name</var> [<var>name</var>]
315 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
316 <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>Indexes</td></tr>
317 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Base</td></tr>
318 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_autoindex</td></tr>
320 <p>This sets the icon to display next to a file ending in
321 <var>name</var> for <code><a href="#indexoptions:fancyindexing">FancyIndexing</a></code>. <var>Icon</var> is either a (%-escaped)
322 relative URL to the icon, or of the format <code>
323 (<var>alttext</var>,<var>url</var>)</code> where <var>alttext</var>
324 is the text tag given for an icon for non-graphical browsers.</p>
326 <p><var>Name</var> is either <code>^^DIRECTORY^^</code> for directories,
327 <code>^^BLANKICON^^</code> for blank lines (to format the list
328 correctly), a file extension, a wildcard expression, a partial
329 filename or a complete filename.</p>
331 <div class="example"><h3>Examples</h3><p><code>
332 AddIcon (IMG,/icons/image.xbm) .gif .jpg .xbm<br />
333 AddIcon /icons/dir.xbm ^^DIRECTORY^^<br />
334 AddIcon /icons/backup.xbm *~
337 <p><code class="directive"><a href="#addiconbytype">AddIconByType</a></code>
338 should be used in preference to <code class="directive">AddIcon</code>,
342 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
343 <div class="directive-section"><h2><a name="AddIconByEncoding" id="AddIconByEncoding">AddIconByEncoding</a> <a name="addiconbyencoding" id="addiconbyencoding">Directive</a></h2>
344 <table class="directive">
345 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Icon to display next to files selected by MIME
346 content-encoding</td></tr>
347 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>AddIconByEncoding <var>icon</var> <var>MIME-encoding</var>
348 [<var>MIME-encoding</var>] ...</code></td></tr>
349 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
350 <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>Indexes</td></tr>
351 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Base</td></tr>
352 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_autoindex</td></tr>
354 <p>This sets the icon to display next to files with <code><a href="#indexoptions:fancyindexing">FancyIndexing</a></code>.
355 <var>Icon</var> is either a (%-escaped) relative URL to the icon,
356 or of the format <code>(<var>alttext</var>,<var>url</var>)</code>
357 where <var>alttext</var> is the text tag given for an icon for
358 non-graphical browsers.</p>
360 <p><var>MIME-encoding</var> is a wildcard expression matching
361 required the content-encoding.</p>
363 <div class="example"><h3>Example</h3><p><code>
364 AddIconByEncoding /icons/compress.xbm x-compress
368 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
369 <div class="directive-section"><h2><a name="AddIconByType" id="AddIconByType">AddIconByType</a> <a name="addiconbytype" id="addiconbytype">Directive</a></h2>
370 <table class="directive">
371 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Icon to display next to files selected by MIME
372 content-type</td></tr>
373 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>AddIconByType <var>icon</var> <var>MIME-type</var>
374 [<var>MIME-type</var>] ...</code></td></tr>
375 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
376 <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>Indexes</td></tr>
377 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Base</td></tr>
378 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_autoindex</td></tr>
380 <p>This sets the icon to display next to files of type
381 <var>MIME-type</var> for <code><a href="#indexoptions:fancyindexing">FancyIndexing</a></code>.
382 <var>Icon</var> is either a (%-escaped) relative URL to the icon,
383 or of the format <code>(<var>alttext</var>,<var>url</var>)</code>
384 where <var>alttext</var> is the text tag given for an icon for
385 non-graphical browsers.</p>
387 <p><var>MIME-type</var> is a wildcard expression matching
388 required the mime types.</p>
390 <div class="example"><h3>Example</h3><p><code>
391 AddIconByType (IMG,/icons/image.xbm) image/*
395 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
396 <div class="directive-section"><h2><a name="DefaultIcon" id="DefaultIcon">DefaultIcon</a> <a name="defaulticon" id="defaulticon">Directive</a></h2>
397 <table class="directive">
398 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Icon to display for files when no specific icon is
400 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>DefaultIcon <var>url-path</var></code></td></tr>
401 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
402 <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>Indexes</td></tr>
403 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Base</td></tr>
404 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_autoindex</td></tr>
406 <p>The <code class="directive">DefaultIcon</code> directive sets the icon
407 to display for files when no specific icon is known, for <code><a href="#indexoptions:fancyindexing">FancyIndexing</a></code>.
408 <var>Url-path</var> is a (%-escaped) relative URL to the icon.</p>
410 <div class="example"><h3>Example</h3><p><code>
411 DefaultIcon /icon/unknown.xbm
415 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
416 <div class="directive-section"><h2><a name="HeaderName" id="HeaderName">HeaderName</a> <a name="headername" id="headername">Directive</a></h2>
417 <table class="directive">
418 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Name of the file that will be inserted at the top
419 of the index listing</td></tr>
420 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>HeaderName <var>filename</var></code></td></tr>
421 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
422 <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>Indexes</td></tr>
423 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Base</td></tr>
424 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_autoindex</td></tr>
426 <p>The <code class="directive">HeaderName</code> directive sets the name
427 of the file that will be inserted at the top of the index
428 listing. <var>Filename</var> is the name of the file to include.</p>
430 <div class="example"><h3>Example</h3><p><code>
431 HeaderName HEADER.html
435 <p>Both HeaderName and <code class="directive"><a href="#readmename">ReadmeName</a></code> now treat
436 <var>Filename</var> as a URI path relative to the one used to
437 access the directory being indexed. If <var>Filename</var> begins
438 with a slash, it will be taken to be relative to the <code class="directive"><a href="../mod/core.html#documentroot">DocumentRoot</a></code>.</p>
440 <div class="example"><h3>Example</h3><p><code>
441 HeaderName /include/HEADER.html
444 <p><var>Filename</var> must resolve to a document with a major
445 content type of <code>text/*</code> (<em>e.g.</em>,
446 <code>text/html</code>, <code>text/plain</code>, etc.). This means
447 that <var>filename</var> may refer to a CGI script if the script's
448 actual file type (as opposed to its output) is marked as
449 <code>text/html</code> such as with a directive like:</p>
451 <div class="example"><p><code>
452 AddType text/html .cgi
455 <p><a href="../content-negotiation.html">Content negotiation</a>
456 will be performed if <code class="directive"><a href="../mod/core.html#options">Options</a></code>
457 <code>MultiViews</code> is in effect. If <var>filename</var> resolves
458 to a static <code>text/html</code> document (not a CGI script) and
459 either one of the <code class="directive"><a href="../mod/core.html#options">options</a></code>
460 <code>Includes</code> or <code>IncludesNOEXEC</code> is enabled,
461 the file will be processed for server-side includes (see the
462 <code class="module"><a href="../mod/mod_include.html">mod_include</a></code> documentation).</p>
465 <p>If the file specified by <code class="directive">HeaderName</code> contains
466 the beginnings of an HTML document (<html>, <head>, etc.)
467 then you will probably want to set <a href="#indexoptions:suppresshtmlpreamble"><code>IndexOptions
468 +SuppressHTMLPreamble</code></a>, so that these tags are not
472 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
473 <div class="directive-section"><h2><a name="IndexIgnore" id="IndexIgnore">IndexIgnore</a> <a name="indexignore" id="indexignore">Directive</a></h2>
474 <table class="directive">
475 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Adds to the list of files to hide when listing
476 a directory</td></tr>
477 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>IndexIgnore <var>file</var> [<var>file</var>] ...</code></td></tr>
478 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
479 <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>Indexes</td></tr>
480 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Base</td></tr>
481 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_autoindex</td></tr>
483 <p>The <code class="directive">IndexIgnore</code> directive adds to the
484 list of files to hide when listing a directory. <var>File</var> is a
485 file extension, partial filename, wildcard expression or full
486 filename for files to ignore. Multiple IndexIgnore directives add
487 to the list, rather than the replacing the list of ignored
488 files. By default, the list contains <code>.</code> (the current
491 <div class="example"><p><code>
492 IndexIgnore README .htaccess *~
496 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
497 <div class="directive-section"><h2><a name="IndexOptions" id="IndexOptions">IndexOptions</a> <a name="indexoptions" id="indexoptions">Directive</a></h2>
498 <table class="directive">
499 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Various configuration settings for directory
501 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>IndexOptions [+|-]<var>option</var> [[+|-]<var>option</var>]
503 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
504 <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>Indexes</td></tr>
505 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Base</td></tr>
506 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_autoindex</td></tr>
508 <p>The <code class="directive">IndexOptions</code> directive specifies the
509 behavior of the directory indexing. <var>Option</var> can be one
513 <dt><a name="indexoptions:descriptionwidth" id="indexoptions:descriptionwidth">DescriptionWidth=[<var>n</var> | *]</a> (<em>Apache 2.0.23 and
516 <dd>The <code>DescriptionWidth</code> keyword allows you to
517 specify the width of the description column in
520 <dd><code>-DescriptionWidth</code> (or unset) allows
521 <code class="module"><a href="../mod/mod_autoindex.html">mod_autoindex</a></code> to calculate the best width.</dd>
523 <dd><code>DescriptionWidth=<var>n</var></code> fixes the column width to
524 <var>n</var> bytes wide.</dd>
526 <dd><code>DescriptionWidth=*</code> grows the column to the
527 width necessary to accommodate the longest description
530 <dd><strong>See the section on <code class="directive"><a href="#adddescription">AddDescription</a></code> for dangers
531 inherent in truncating descriptions.</strong></dd>
533 <dt><a name="indexoptions:fancyindexing" id="indexoptions:fancyindexing">FancyIndexing</a></dt>
535 <dd>This turns on fancy indexing of directories.</dd>
537 <dt><a name="indexoptions:foldersfirst" id="indexoptions:foldersfirst">FoldersFirst</a> (<em>Apache
538 2.0.23 and later</em>)</dt>
540 <dd>If this option is enabled, subdirectory listings will
541 <em>always</em> appear first, followed by normal files in the
542 directory. The listing is basically broken into two
543 components, the files and the subdirectories, and each is
544 sorted separately and then displayed subdirectories-first.
545 For instance, if the sort order is descending by name, and
546 <code>FoldersFirst</code> is enabled, subdirectory
547 <code>Zed</code> will be listed before subdirectory
548 <code>Beta</code>, which will be listed before normal files
549 <code>Gamma</code> and <code>Alpha</code>. <strong>This option
550 only has an effect if <a href="#indexoptions:fancyindexing"><code>FancyIndexing</code></a> is also enabled.</strong></dd>
552 <dt><a name="indexoptions:htmltable" id="indexoptions:htmltable">HTMLTable</a> (<em>Experimental,
553 Apache 2.0.23 and later</em>)</dt>
555 <dd>This experimental option with FancyIndexing constructs a
556 simple table for the fancy directory listing. Note this will
557 confuse older browsers. It is particularly necessary if file
558 names or description text will alternate between
559 left-to-right and right-to-left reading order, as can happen
560 on WinNT or other utf-8 enabled platforms.</dd>
562 <dt><a name="indexoptions:iconsarelinks" id="indexoptions:iconsarelinks">IconsAreLinks</a></dt>
564 <dd>This makes the icons part of the anchor for the filename, for
567 <dt><a name="indexoptions:iconheight" id="indexoptions:iconheight">IconHeight[=<var>pixels</var>]</a></dt>
569 <dd>Presence of this option, when used with IconWidth, will cause
570 the server to include <code>height</code> and <code>width</code>
571 attributes in the <code>img</code> tag for the file icon. This allows
572 browser to precalculate the page layout without having to wait until
573 all the images have been loaded. If no value is given for the option,
574 it defaults to the standard height of the icons supplied with the Apache
577 <dt><a name="indexoptions:iconwidth" id="indexoptions:iconwidth">IconWidth[=<var>pixels</var>]</a></dt>
579 <dd>Presence of this option, when used with <code>IconHeight</code>,
580 will cause the server to include <code>height</code> and
581 <code>width</code> attributes in the <code>img</code> tag for
582 the file icon. This allows browser to precalculate the page
583 layout without having to wait until all the images have been
584 loaded. If no value is given for the option, it defaults to
585 the standard width of the icons supplied with the Apache
588 <dt><a name="indexoptions:ignorecase" id="indexoptions:ignorecase">IgnoreCase</a></dt>
590 <dd>If this option is enabled, names are sorted in a case-insensitive
591 manner. For instance, if the sort order is ascending by name, and
592 IgnoreCase is enabled, file Zeta will be listed after file alfa
593 (Note: file GAMMA will always be listed before file gamma). </dd>
595 <dt><a name="indexoptions:ignoreclient" id="indexoptions:ignoreclient">IgnoreClient</a></dt>
597 <dd>This option causes <code class="module"><a href="../mod/mod_autoindex.html">mod_autoindex</a></code> to ignore all
598 query variables from the client, including sort order (implies
599 <code><a href="#indexoptions:suppresscolumnsorting">SuppressColumnSorting</a></code>.)</dd>
601 <dt><a name="indexoptions:namewidth" id="indexoptions:namewidth">NameWidth=[<var>n</var>
604 <dd>The <code>NameWidth</code> keyword allows you to specify the width
605 of the filename column in bytes.</dd>
607 <dd><code>-NameWidth</code> (or unset) allows <code class="module"><a href="../mod/mod_autoindex.html">mod_autoindex</a></code> to calculate the best width.</dd>
609 <dd><code>NameWidth=<var>n</var></code> fixes the column width to
610 <var>n</var> bytes wide.</dd>
612 <dd><code>NameWidth=*</code> grows the column to the necessary
615 <dt><a name="indexoptions:scanhtmltitles" id="indexoptions:scanhtmltitles">ScanHTMLTitles</a></dt>
617 <dd>This enables the extraction of the title from HTML documents
618 for fancy indexing. If the file does not have a description
619 given by <code class="directive"><a href="#adddescription">AddDescription</a></code>
620 then httpd will read the document for the value of the
621 <code>title</code> element. This is CPU and disk intensive.</dd>
623 <dt><a name="indexoptions:suppresscolumnsorting" id="indexoptions:suppresscolumnsorting">SuppressColumnSorting</a></dt>
625 <dd>If specified, Apache will not make the column headings in a
626 FancyIndexed directory listing into links for sorting. The
627 default behavior is for them to be links; selecting the
628 column heading will sort the directory listing by the values
629 in that column. <strong>Prior to Apache 2.0.23, this also
630 disabled parsing the Query Arguments for the sort
631 string.</strong> That behavior is now controlled by <a href="#indexoptions:ignoreclient">IndexOptions
632 IgnoreClient</a> in Apache 2.0.23.</dd>
634 <dt><a name="indexoptions:suppressdescription" id="indexoptions:suppressdescription">SuppressDescription</a></dt>
636 <dd>This will suppress the file description in fancy indexing
637 listings. By default, no file descriptions are defined, and
638 so the use of this option will regain 23 characters of screen
639 space to use for something else. See <code class="directive"><a href="#adddescription">AddDescription</a></code> for information about setting the file
640 description. See also the <code><a href="#indexoptions:descriptionwidth">DescriptionWidth</a></code>
641 index option to limit the size of the description column.</dd>
643 <dt><a name="indexoptions:suppresshtmlpreamble" id="indexoptions:suppresshtmlpreamble">SuppressHTMLPreamble</a></dt>
645 <dd>If the directory actually contains a file specified by the
646 <code class="directive"><a href="#headername">HeaderName</a></code>
647 directive, the module usually includes the contents of the file
648 after a standard HTML preamble (<code><html></code>,
649 <code><head></code>, <em>et cetera</em>). The
650 <code>SuppressHTMLPreamble</code> option disables this behaviour,
651 causing the module to start the display with the header file
652 contents. The header file must contain appropriate HTML instructions
653 in this case. If there is no header file, the preamble is generated
656 <dt><a name="indexoptions:suppressicon" id="indexoptions:suppressicon">SuppressIcon</a> (<em>Apache
657 2.0.23 and later</em>)</dt>
659 <dd>This will suppress the icon in fancy indexing listings.
660 Combining both <code>SuppressIcon</code> and
661 <code>SuppressRules</code> yields proper HTML 3.2 output, which
662 by the final specification prohibits <code>img</code> and
663 <code>hr</code> elements from the <code>pre</code> block (used to
664 format FancyIndexed listings.)</dd>
666 <dt><a name="indexoptions:suppresslastmodified" id="indexoptions:suppresslastmodified">SuppressLastModified</a></dt>
668 <dd>This will suppress the display of the last modification date,
669 in fancy indexing listings.</dd>
671 <dt><a name="indexoptions:suppressrules" id="indexoptions:suppressrules">SuppressRules</a>
672 (<em>Apache 2.0.23 and later</em>)</dt>
674 <dd>This will suppress the horizontal rule lines (<code>hr</code>
675 elements) in directory listings. Combining both <code>SuppressIcon</code> and
676 <code>SuppressRules</code> yields proper HTML 3.2 output, which
677 by the final specification prohibits <code>img</code> and
678 <code>hr</code> elements from the <code>pre</code> block (used to
679 format FancyIndexed listings.)</dd>
681 <dt><a name="indexoptions:suppresssize" id="indexoptions:suppresssize">SuppressSize</a></dt>
683 <dd>This will suppress the file size in fancy indexing listings.</dd>
685 <dt><a name="indexoptions:trackmodified" id="indexoptions:trackmodified">TrackModified</a> (<em>Apache
686 2.0.23 and later</em>)</dt>
688 <dd>This returns the Last-Modified and ETag values for the listed
689 directory in the HTTP header. It is only valid if the
690 operating system and file system return appropriate stat()
691 results. Some Unix systems do so, as do OS2's JFS and Win32's
692 NTFS volumes. OS2 and Win32 FAT volumes, for example, do not.
693 Once this feature is enabled, the client or proxy can track
694 changes to the list of files when they perform a <code>HEAD</code>
695 request. Note some operating systems correctly track new and
696 removed files, but do not track changes for sizes or dates of
697 the files within the directory. <strong>Changes to the size
698 or date stamp of an existing file will not update the
699 Last-Modified header on all Unix platforms.</strong> If this
700 is a concern, leave this option disabled.</dd>
702 <dt><a name="indexoptions:versionsort" id="indexoptions:versionsort">VersionSort</a>
703 (<em>Apache 2.0a3 and later</em>)</dt>
705 <dd>The <code>VersionSort</code> keyword causes files containing
706 version numbers to sort in a natural way. Strings are sorted as
707 usual, except that substrings of digits in the name and
708 description are compared according to their numeric value.
710 <div class="example"><h3>Example:</h3><p><code>
719 <p>If the number starts with a zero, then it is considered to
722 <div class="example"><p><code>
732 <dl><dt>Incremental IndexOptions</dt>
734 <p>Apache 1.3.3 introduced some significant changes in the
735 handling of <code class="directive">IndexOptions</code> directives. In
739 <li>Multiple <code class="directive">IndexOptions</code> directives for a
740 single directory are now merged together. The result of:
742 <div class="example"><p><code>
743 <Directory /foo>
744 <span class="indent">
745 IndexOptions HTMLTable<br />
746 IndexOptions SuppressColumnsorting
751 <p>will be the equivalent of</p>
753 <div class="example"><p><code>
754 IndexOptions HTMLTable SuppressColumnsorting
758 <li>The addition of the incremental syntax (<em>i.e.</em>, prefixing
759 keywords with <code>+</code> or <code>-</code>).</li>
762 <p>Whenever a '+' or '-' prefixed keyword is encountered, it
763 is applied to the current <code class="directive">IndexOptions</code>
764 settings (which may have been inherited from an upper-level
765 directory). However, whenever an unprefixed keyword is processed, it
766 clears all inherited options and any incremental settings encountered
767 so far. Consider the following example:</p>
769 <div class="example"><p><code>
770 IndexOptions +ScanHTMLTitles -IconsAreLinks FancyIndexing<br />
771 IndexOptions +SuppressSize
774 <p>The net effect is equivalent to <code>IndexOptions FancyIndexing
775 +SuppressSize</code>, because the unprefixed <code>FancyIndexing</code>
776 discarded the incremental keywords before it, but allowed them to
777 start accumulating again afterward.</p>
779 <p>To unconditionally set the <code class="directive">IndexOptions</code> for
780 a particular directory, clearing the inherited settings, specify
781 keywords without any <code>+</code> or <code>-</code> prefixes.</p>
786 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
787 <div class="directive-section"><h2><a name="IndexOrderDefault" id="IndexOrderDefault">IndexOrderDefault</a> <a name="indexorderdefault" id="indexorderdefault">Directive</a></h2>
788 <table class="directive">
789 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Sets the default ordering of the directory index</td></tr>
790 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>IndexOrderDefault Ascending|Descending
791 Name|Date|Size|Description</code></td></tr>
792 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>IndexOrderDefault Ascending Name</code></td></tr>
793 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
794 <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>Indexes</td></tr>
795 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Base</td></tr>
796 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_autoindex</td></tr>
798 <p>The <code class="directive">IndexOrderDefault</code> directive is used
799 in combination with the <code><a href="#indexoptions:fancyindexing">FancyIndexing</a></code> index option. By default, fancyindexed
800 directory listings are displayed in ascending order by filename; the
801 <code class="directive">IndexOrderDefault</code> allows you to change this
802 initial display order.</p>
804 <p><code class="directive">IndexOrderDefault</code> takes two
805 arguments. The first must be either <code>Ascending</code> or
806 <code>Descending</code>, indicating the direction of the sort.
807 The second argument must be one of the keywords <code>Name</code>,
808 <code>Date</code>, <code>Size</code>, or <code>Description</code>,
809 and identifies the primary key. The secondary key is
810 <em>always</em> the ascending filename.</p>
812 <p>You can force a directory listing to only be displayed in a
813 particular order by combining this directive with the <code><a href="#indexoptions:suppresscolumnsorting">SuppressColumnSorting</a></code> index option; this will prevent
814 the client from requesting the directory listing in a different
818 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
819 <div class="directive-section"><h2><a name="ReadmeName" id="ReadmeName">ReadmeName</a> <a name="readmename" id="readmename">Directive</a></h2>
820 <table class="directive">
821 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Name of the file that will be inserted at the end
822 of the index listing</td></tr>
823 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ReadmeName <var>filename</var></code></td></tr>
824 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
825 <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>Indexes</td></tr>
826 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Base</td></tr>
827 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_autoindex</td></tr>
829 <p>The <code class="directive">ReadmeName</code> directive sets the name
830 of the file that will be appended to the end of the index
831 listing. <var>Filename</var> is the name of the file to include, and
832 is taken to be relative to the location being indexed. If
833 <var>Filename</var> begins with a slash, it will be taken to be
834 relative to the <code class="directive"><a href="../mod/core.html#documentroot">DocumentRoot</a></code>.
837 <div class="example"><h3>Example</h3><p><code>
838 ReadmeName FOOTER.html
841 <div class="example"><h3>Example 2</h3><p><code>
842 ReadmeName /include/FOOTER.html
845 <p>See also <code class="directive"><a href="#headername">HeaderName</a></code>, where this behavior is described in greater
851 <p class="apache">Maintained by the <a href="http://httpd.apache.org/docs-project/">Apache HTTP Server Documentation Project</a></p>
852 <p class="menu"><a href="../mod/">Modules</a> | <a href="../mod/directives.html">Directives</a> | <a href="../faq/">FAQ</a> | <a href="../glossary.html">Glossary</a> | <a href="../sitemap.html">Sitemap</a></p></div>