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 7 --> 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" /><link rel="stylesheet" type="text/css" href="/style/css/prettify.css" /> 12<script src="/style/scripts/prettify.min.js" type="text/javascript"> 13</script> 14 15<link href="/images/favicon.ico" rel="shortcut icon" /></head> 16<body> 17<div id="page-header"> 18<p class="menu"><a href="/mod/">Modules</a> | <a href="/mod/directives.html">Directives</a> | <a href="http://wiki.apache.org/httpd/FAQ">FAQ</a> | <a href="/glossary.html">Glossary</a> | <a href="/sitemap.html">Sitemap</a></p> 19<p class="apache">Apache HTTP Server Version 2.4</p> 20<img alt="" src="/images/feather.gif" /></div> 21<div class="up"><a href="./"><img title="<-" alt="<-" src="/images/left.gif" /></a></div> 22<div id="path"> 23<a href="http://www.apache.org/">Apache</a> > <a href="http://httpd.apache.org/">HTTP Server</a> > <a href="http://httpd.apache.org/docs/">Documentation</a> > <a href="../">Version 2.4</a> > <a href="./">Modules</a></div> 24<div id="page-content"> 25<div id="preamble"><h1>Apache Module mod_autoindex</h1> 26<div class="toplang"> 27<p><span>Available Languages: </span><a href="/en/mod/mod_autoindex.html" title="English"> en </a> | 28<a href="/fr/mod/mod_autoindex.html" hreflang="fr" rel="alternate" title="Fran�ais"> fr </a> | 29<a href="/ja/mod/mod_autoindex.html" hreflang="ja" rel="alternate" title="Japanese"> ja </a> | 30<a href="/ko/mod/mod_autoindex.html" hreflang="ko" rel="alternate" title="Korean"> ko </a> | 31<a href="/tr/mod/mod_autoindex.html" hreflang="tr" rel="alternate" title="T�rk�e"> tr </a></p> 32</div> 33<table class="module"><tr><th><a href="module-dict.html#Description">Description:</a></th><td>Generates directory indexes, 34 automatically, similar to the Unix <code>ls</code> command or the 35 Win32 <code>dir</code> shell command</td></tr> 36<tr><th><a href="module-dict.html#Status">Status:</a></th><td>Base</td></tr> 37<tr><th><a href="module-dict.html#ModuleIdentifier">Module�Identifier:</a></th><td>autoindex_module</td></tr> 38<tr><th><a href="module-dict.html#SourceFile">Source�File:</a></th><td>mod_autoindex.c</td></tr></table> 39<h3>Summary</h3> 40 41 <p>The index of a directory can come from one of two 42 sources:</p> 43 44 <ul> 45 <li>A file located in that directory, typically called 46 <code>index.html</code>. The <code class="directive"><a href="/mod/mod_dir.html#directoryindex">DirectoryIndex</a></code> directive sets the 47 name of the file or files to be used. This is controlled by 48 <code class="module"><a href="/mod/mod_dir.html">mod_dir</a></code>.</li> 49 50 <li>Otherwise, a listing generated by the server. The other 51 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 52 <code class="directive"><a href="#addiconbytype">AddIconByType</a></code> are 53 used to set a list of icons to display for various file types; 54 for each file listed, the first icon listed that matches the 55 file is displayed. These are controlled by 56 <code class="module"><a href="/mod/mod_autoindex.html">mod_autoindex</a></code>.</li> 57 </ul> 58 <p>The two functions are separated so that you can completely 59 remove (or replace) automatic index generation should you want 60 to.</p> 61 62 <p>Automatic index generation is enabled with using 63 <code>Options +Indexes</code>. See the 64 <code class="directive"><a href="/mod/core.html#options">Options</a></code> directive for 65 more details.</p> 66 67 <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, 68 the column headers are links that control the order of the 69 display. If you select a header link, the listing will be 70 regenerated, sorted by the values in that column. Selecting the 71 same header repeatedly toggles between ascending and descending 72 order. These column header links are suppressed with the 73 <code class="directive"><a href="#indexoptions">IndexOptions</a></code> directive's 74 <code><a href="#indexoptions.suppresscolumnsorting">SuppressColumnSorting</a></code> 75 option.</p> 76 77 <p>Note that when the display is sorted by "Size", it's the 78 <em>actual</em> size of the files that's used, not the 79 displayed value - so a 1010-byte file will always be displayed 80 before a 1011-byte file (if in ascending order) even though 81 they both are shown as "1K".</p> 82</div> 83<div id="quickview"><h3 class="directives">Directives</h3> 84<ul id="toc"> 85<li><img alt="" src="/images/down.gif" /> <a href="#addalt">AddAlt</a></li> 86<li><img alt="" src="/images/down.gif" /> <a href="#addaltbyencoding">AddAltByEncoding</a></li> 87<li><img alt="" src="/images/down.gif" /> <a href="#addaltbytype">AddAltByType</a></li> 88<li><img alt="" src="/images/down.gif" /> <a href="#adddescription">AddDescription</a></li> 89<li><img alt="" src="/images/down.gif" /> <a href="#addicon">AddIcon</a></li> 90<li><img alt="" src="/images/down.gif" /> <a href="#addiconbyencoding">AddIconByEncoding</a></li> 91<li><img alt="" src="/images/down.gif" /> <a href="#addiconbytype">AddIconByType</a></li> 92<li><img alt="" src="/images/down.gif" /> <a href="#defaulticon">DefaultIcon</a></li> 93<li><img alt="" src="/images/down.gif" /> <a href="#headername">HeaderName</a></li> 94<li><img alt="" src="/images/down.gif" /> <a href="#indexheadinsert">IndexHeadInsert</a></li> 95<li><img alt="" src="/images/down.gif" /> <a href="#indexignore">IndexIgnore</a></li> 96<li><img alt="" src="/images/down.gif" /> <a href="#indexignorereset">IndexIgnoreReset</a></li> 97<li><img alt="" src="/images/down.gif" /> <a href="#indexoptions">IndexOptions</a></li> 98<li><img alt="" src="/images/down.gif" /> <a href="#indexorderdefault">IndexOrderDefault</a></li> 99<li><img alt="" src="/images/down.gif" /> <a href="#indexstylesheet">IndexStyleSheet</a></li> 100<li><img alt="" src="/images/down.gif" /> <a href="#readmename">ReadmeName</a></li> 101</ul> 102<h3>Topics</h3> 103<ul id="topics"> 104<li><img alt="" src="/images/down.gif" /> <a href="#query">Autoindex Request Query Arguments</a></li> 105</ul><ul class="seealso"><li><a href="#comments_section">Comments</a></li></ul></div> 106<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div> 107<div class="section"> 108<h2><a name="query" id="query">Autoindex Request Query Arguments</a></h2> 109 110 111 <p>Various query string arguments are available to give the client 112 some control over the ordering of the directory listing, as well as 113 what files are listed. If you do not wish to give the client this 114 control, the <code><a href="#indexoptions.ignoreclient">IndexOptions 115 IgnoreClient</a></code> option disables that functionality.</p> 116 117 <p>The column sorting headers themselves are self-referencing 118 hyperlinks that add the sort query options shown below. Any 119 option below may be added to any request for the directory 120 resource.</p> 121 122 <ul> 123 <li><code>C=N</code> sorts the directory by file name</li> 124 125 <li><code>C=M</code> sorts the directory by last-modified 126 date, then file name</li> 127 128 <li><code>C=S</code> sorts the directory by size, then file 129 name</li> 130 131 <li class="separate"><code>C=D</code> sorts the directory by description, then 132 file name</li> 133 134 <li><code>O=A</code> sorts the listing in Ascending 135 Order</li> 136 137 <li class="separate"><code>O=D</code> sorts the listing in Descending 138 Order</li> 139 140 <li><code>F=0</code> formats the listing as a simple list 141 (not FancyIndexed)</li> 142 143 <li><code>F=1</code> formats the listing as a FancyIndexed 144 list</li> 145 146 <li class="separate"><code>F=2</code> formats the listing as an 147 HTMLTable FancyIndexed list</li> 148 149 <li><code>V=0</code> disables version sorting</li> 150 151 <li class="separate"><code>V=1</code> enables version sorting</li> 152 153 <li><code>P=<var>pattern</var></code> lists only files matching 154 the given <var>pattern</var></li> 155 </ul> 156 157 <p>Note that the 'P'attern query argument is tested 158 <em>after</em> the usual <code class="directive"><a href="#indexignore">IndexIgnore</a></code> directives are processed, 159 and all file names are still subjected to the same criteria as 160 any other autoindex listing. The Query Arguments parser in 161 <code class="module"><a href="/mod/mod_autoindex.html">mod_autoindex</a></code> will stop abruptly when an unrecognized 162 option is encountered. The Query Arguments must be well formed, 163 according to the table above.</p> 164 165 <p>The simple example below, which can be clipped and saved in 166 a header.html file, illustrates these query options. Note that 167 the unknown "X" argument, for the submit button, is listed last 168 to assure the arguments are all parsed before mod_autoindex 169 encounters the X=Go input.</p> 170 171 <div class="example"><p><code> 172 <form action="" method="get"><br /> 173 <span class="indent"> 174 Show me a <select name="F"><br /> 175 <span class="indent"> 176 <option value="0"> Plain list</option><br /> 177 <option value="1" selected="selected"> Fancy list</option><br /> 178 <option value="2"> Table list</option><br /> 179 </span> 180 </select><br /> 181 Sorted by <select name="C"><br /> 182 <span class="indent"> 183 <option value="N" selected="selected"> Name</option><br /> 184 <option value="M"> Date Modified</option><br /> 185 <option value="S"> Size</option><br /> 186 <option value="D"> Description</option><br /> 187 </span> 188 </select><br /> 189 <select name="O"><br /> 190 <span class="indent"> 191 <option value="A" selected="selected"> Ascending</option><br /> 192 <option value="D"> Descending</option><br /> 193 </span> 194 </select><br /> 195 <select name="V"><br /> 196 <span class="indent"> 197 <option value="0" selected="selected"> in Normal order</option><br /> 198 <option value="1"> in Version order</option><br /> 199 </span> 200 </select><br /> 201 Matching <input type="text" name="P" value="*" /><br /> 202 <input type="submit" name="X" value="Go" /><br /> 203 </span> 204 </form> 205 </code></p></div> 206 207</div> 208<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div> 209<div class="directive-section"><h2><a name="AddAlt" id="AddAlt">AddAlt</a> <a name="addalt" id="addalt">Directive</a></h2> 210<table class="directive"> 211<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Alternate text to display for a file, instead of an 212icon selected by filename</td></tr> 213<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> 214<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr> 215<tr><th><a href="directive-dict.html#Override">Override:</a></th><td>Indexes</td></tr> 216<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Base</td></tr> 217<tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_autoindex</td></tr> 218</table> 219 <p><code class="directive">AddAlt</code> provides the alternate text to 220 display for a file, instead of an icon, for <code><a href="#indexoptions.fancyindexing">FancyIndexing</a></code>. 221 <var>File</var> is a file extension, partial filename, wild-card 222 expression or full filename for files to describe. 223 If <var>String</var> contains any whitespace, you have to enclose it 224 in quotes (<code>"</code> or <code>'</code>). This alternate text 225 is displayed if the client is image-incapable, has image loading 226 disabled, or fails to retrieve the icon.</p> 227 228 <pre class="prettyprint lang-config">AddAlt "PDF file" *.pdf 229AddAlt Compressed *.gz *.zip *.Z</pre> 230 231 232</div> 233<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div> 234<div class="directive-section"><h2><a name="AddAltByEncoding" id="AddAltByEncoding">AddAltByEncoding</a> <a name="addaltbyencoding" id="addaltbyencoding">Directive</a></h2> 235<table class="directive"> 236<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Alternate text to display for a file instead of an icon 237selected by MIME-encoding</td></tr> 238<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>AddAltByEncoding <var>string</var> <var>MIME-encoding</var> 239[<var>MIME-encoding</var>] ...</code></td></tr> 240<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr> 241<tr><th><a href="directive-dict.html#Override">Override:</a></th><td>Indexes</td></tr> 242<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Base</td></tr> 243<tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_autoindex</td></tr> 244</table> 245 <p><code class="directive">AddAltByEncoding</code> provides the alternate 246 text to display for a file, instead of an icon, for <code><a href="#indexoptions.fancyindexing">FancyIndexing</a></code>. 247 <var>MIME-encoding</var> is a valid content-encoding, such as 248 <code>x-compress</code>. If <var>String</var> contains any whitespace, 249 you have to enclose it in quotes (<code>"</code> or <code>'</code>). 250 This alternate text is displayed if the client is image-incapable, 251 has image loading disabled, or fails to retrieve the icon.</p> 252 253 <pre class="prettyprint lang-config">AddAltByEncoding gzip x-gzip</pre> 254 255 256</div> 257<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div> 258<div class="directive-section"><h2><a name="AddAltByType" id="AddAltByType">AddAltByType</a> <a name="addaltbytype" id="addaltbytype">Directive</a></h2> 259<table class="directive"> 260<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Alternate text to display for a file, instead of an 261icon selected by MIME content-type</td></tr> 262<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>AddAltByType <var>string</var> <var>MIME-type</var> 263[<var>MIME-type</var>] ...</code></td></tr> 264<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr> 265<tr><th><a href="directive-dict.html#Override">Override:</a></th><td>Indexes</td></tr> 266<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Base</td></tr> 267<tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_autoindex</td></tr> 268</table> 269 <p><code class="directive">AddAltByType</code> sets the alternate text to 270 display for a file, instead of an icon, for <code><a href="#indexoptions.fancyindexing">FancyIndexing</a></code>. 271 <var>MIME-type</var> is a valid content-type, such as 272 <code>text/html</code>. If <var>String</var> contains any whitespace, 273 you have to enclose it in quotes (<code>"</code> or <code>'</code>). 274 This alternate text is displayed if the client is image-incapable, 275 has image loading disabled, or fails to retrieve the icon.</p> 276 277 <pre class="prettyprint lang-config">AddAltByType 'plain text' text/plain</pre> 278 279 280</div> 281<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div> 282<div class="directive-section"><h2><a name="AddDescription" id="AddDescription">AddDescription</a> <a name="adddescription" id="adddescription">Directive</a></h2> 283<table class="directive"> 284<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Description to display for a file</td></tr> 285<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>AddDescription <var>string file</var> [<var>file</var>] ...</code></td></tr> 286<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr> 287<tr><th><a href="directive-dict.html#Override">Override:</a></th><td>Indexes</td></tr> 288<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Base</td></tr> 289<tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_autoindex</td></tr> 290</table> 291 <p>This sets the description to display for a file, for 292 <code><a href="#indexoptions.fancyindexing">FancyIndexing</a></code>. 293 <var>File</var> is a file extension, partial filename, wild-card 294 expression or full filename for files to describe. 295 <var>String</var> is enclosed in double quotes (<code>"</code>).</p> 296 297 <pre class="prettyprint lang-config">AddDescription "The planet Mars" mars.gif 298AddDescription "My friend Marshall" friends/mars.gif</pre> 299 300 301 <p>The typical, default description field is 23 bytes wide. 6 302 more bytes are added by the <code><a href="#indexoptions.suppressicon">IndexOptions SuppressIcon</a></code> option, 7 bytes are 303 added by the <code><a href="#indexoptions.suppresssize">IndexOptions SuppressSize</a></code> option, and 19 bytes are 304 added by the <code><a href="#indexoptions.suppresslastmodified">IndexOptions SuppressLastModified</a></code> option. 305 Therefore, the widest default the description column is ever 306 assigned is 55 bytes.</p> 307 308 <p>Since the <var>File</var> argument may be a partial file name, 309 please remember that a too-short partial filename may match 310 unintended files. For example, <code>le.html</code> will match the 311 file <code>le.html</code> but will also match the file 312 <code>example.html</code>. In the event that there may be ambiguity, 313 use as complete a filename as you can, but keep in mind that the 314 first match encountered will be used, and order your list of 315 <code>AddDescription</code> directives accordingly.</p> 316 317 <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 318 of this column, or allowing descriptions of unlimited length.</p> 319 320 <div class="note"><h3>Caution</h3> 321 <p>Descriptive text defined with <code class="directive">AddDescription</code> 322 may contain HTML markup, such as tags and character entities. If the 323 width of the description column should happen to truncate a tagged 324 element (such as cutting off the end of a bolded phrase), the 325 results may affect the rest of the directory listing.</p> 326 </div> 327 328 <div class="note"><h3>Arguments with path information</h3> 329 <p>Absolute paths are not currently supported and do not match 330 anything at runtime. Arguments with relative path information, 331 which would normally only be used in htaccess context, are implicitly 332 prefixed with '*/' to avoid matching partial directory names.</p> 333 </div> 334 335 336</div> 337<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div> 338<div class="directive-section"><h2><a name="AddIcon" id="AddIcon">AddIcon</a> <a name="addicon" id="addicon">Directive</a></h2> 339<table class="directive"> 340<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Icon to display for a file selected by name</td></tr> 341<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>AddIcon <var>icon</var> <var>name</var> [<var>name</var>] 342...</code></td></tr> 343<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr> 344<tr><th><a href="directive-dict.html#Override">Override:</a></th><td>Indexes</td></tr> 345<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Base</td></tr> 346<tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_autoindex</td></tr> 347</table> 348 <p>This sets the icon to display next to a file ending in 349 <var>name</var> for <code><a href="#indexoptions.fancyindexing">FancyIndexing</a></code>. <var>Icon</var> is either a (%-escaped) 350 relative URL to the icon, a fully qualified remote URL, or of the format <code> 351 (<var>alttext</var>,<var>url</var>)</code> where <var>alttext</var> 352 is the text tag given for an icon for non-graphical browsers.</p> 353 354 <p><var>Name</var> is either <code>^^DIRECTORY^^</code> for directories, 355 <code>^^BLANKICON^^</code> for blank lines (to format the list 356 correctly), a file extension, a wildcard expression, a partial 357 filename or a complete filename.</p> 358 359 <p><code>^^BLANKICON^^</code> is only used for formatting, and so 360 is unnecessary if you're using <code>IndexOptions 361 HTMLTable</code>.</p> 362 363 <pre class="prettyprint lang-config">#Examples 364AddIcon (IMG,/icons/image.png) .gif .jpg .png 365AddIcon /icons/dir.png ^^DIRECTORY^^ 366AddIcon /icons/backup.png *~</pre> 367 368 369 <p><code class="directive"><a href="#addiconbytype">AddIconByType</a></code> 370 should be used in preference to <code class="directive">AddIcon</code>, 371 when possible.</p> 372 373</div> 374<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div> 375<div class="directive-section"><h2><a name="AddIconByEncoding" id="AddIconByEncoding">AddIconByEncoding</a> <a name="addiconbyencoding" id="addiconbyencoding">Directive</a></h2> 376<table class="directive"> 377<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Icon to display next to files selected by MIME 378content-encoding</td></tr> 379<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>AddIconByEncoding <var>icon</var> <var>MIME-encoding</var> 380[<var>MIME-encoding</var>] ...</code></td></tr> 381<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr> 382<tr><th><a href="directive-dict.html#Override">Override:</a></th><td>Indexes</td></tr> 383<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Base</td></tr> 384<tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_autoindex</td></tr> 385</table> 386 <p>This sets the icon to display next to files with <code><a href="#indexoptions.fancyindexing">FancyIndexing</a></code>. 387 <var>Icon</var> is either a (%-escaped) relative URL to the icon, 388 a fully qualified remote URL, 389 or of the format <code>(<var>alttext</var>,<var>url</var>)</code> 390 where <var>alttext</var> is the text tag given for an icon for 391 non-graphical browsers.</p> 392 393 <p><var>MIME-encoding</var> is a valid content-encoding, such as 394 <code>x-compress</code>.</p> 395 396 <pre class="prettyprint lang-config">AddIconByEncoding /icons/compress.png x-compress</pre> 397 398 399</div> 400<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div> 401<div class="directive-section"><h2><a name="AddIconByType" id="AddIconByType">AddIconByType</a> <a name="addiconbytype" id="addiconbytype">Directive</a></h2> 402<table class="directive"> 403<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Icon to display next to files selected by MIME 404content-type</td></tr> 405<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>AddIconByType <var>icon</var> <var>MIME-type</var> 406[<var>MIME-type</var>] ...</code></td></tr> 407<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr> 408<tr><th><a href="directive-dict.html#Override">Override:</a></th><td>Indexes</td></tr> 409<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Base</td></tr> 410<tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_autoindex</td></tr> 411</table> 412 <p>This sets the icon to display next to files of type 413 <var>MIME-type</var> for <code><a href="#indexoptions.fancyindexing">FancyIndexing</a></code>. 414 <var>Icon</var> is either a (%-escaped) relative URL to the icon, 415 a fully qualified remote URL, 416 or of the format <code>(<var>alttext</var>,<var>url</var>)</code> 417 where <var>alttext</var> is the text tag given for an icon for 418 non-graphical browsers.</p> 419 420 <p><var>MIME-type</var> is a wildcard expression matching 421 required the mime types.</p> 422 423 <pre class="prettyprint lang-config">AddIconByType (IMG,/icons/image.png) image/*</pre> 424 425 426</div> 427<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div> 428<div class="directive-section"><h2><a name="DefaultIcon" id="DefaultIcon">DefaultIcon</a> <a name="defaulticon" id="defaulticon">Directive</a></h2> 429<table class="directive"> 430<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Icon to display for files when no specific icon is 431configured</td></tr> 432<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>DefaultIcon <var>url-path</var></code></td></tr> 433<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr> 434<tr><th><a href="directive-dict.html#Override">Override:</a></th><td>Indexes</td></tr> 435<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Base</td></tr> 436<tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_autoindex</td></tr> 437</table> 438 <p>The <code class="directive">DefaultIcon</code> directive sets the icon 439 to display for files when no specific icon is known, for <code><a href="#indexoptions.fancyindexing">FancyIndexing</a></code>. 440 <var>Url-path</var> is a (%-escaped) relative URL to the icon, 441 or a fully qualified remote URL.</p> 442 443 <pre class="prettyprint lang-config">DefaultIcon /icon/unknown.png</pre> 444 445 446</div> 447<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div> 448<div class="directive-section"><h2><a name="HeaderName" id="HeaderName">HeaderName</a> <a name="headername" id="headername">Directive</a></h2> 449<table class="directive"> 450<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Name of the file that will be inserted at the top 451of the index listing</td></tr> 452<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>HeaderName <var>filename</var></code></td></tr> 453<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr> 454<tr><th><a href="directive-dict.html#Override">Override:</a></th><td>Indexes</td></tr> 455<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Base</td></tr> 456<tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_autoindex</td></tr> 457</table> 458 <p>The <code class="directive">HeaderName</code> directive sets the name 459 of the file that will be inserted at the top of the index 460 listing. <var>Filename</var> is the name of the file to include.</p> 461 462 <pre class="prettyprint lang-config">HeaderName HEADER.html</pre> 463 464 465 <div class="note"> 466 <p>Both HeaderName and <code class="directive"><a href="#readmename">ReadmeName</a></code> now treat 467 <var>Filename</var> as a URI path relative to the one used to 468 access the directory being indexed. If <var>Filename</var> begins 469 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> 470 471 <pre class="prettyprint lang-config">HeaderName /include/HEADER.html</pre> 472 473 474 <p><var>Filename</var> must resolve to a document with a major 475 content type of <code>text/*</code> (<em>e.g.</em>, 476 <code>text/html</code>, <code>text/plain</code>, etc.). This means 477 that <var>filename</var> may refer to a CGI script if the script's 478 actual file type (as opposed to its output) is marked as 479 <code>text/html</code> such as with a directive like:</p> 480 481 <pre class="prettyprint lang-config">AddType text/html .cgi</pre> 482 483 484 <p><a href="/content-negotiation.html">Content negotiation</a> 485 will be performed if <code class="directive"><a href="/mod/core.html#options">Options</a></code> 486 <code>MultiViews</code> is in effect. If <var>filename</var> resolves 487 to a static <code>text/html</code> document (not a CGI script) and 488 either one of the <code class="directive"><a href="/mod/core.html#options">options</a></code> 489 <code>Includes</code> or <code>IncludesNOEXEC</code> is enabled, 490 the file will be processed for server-side includes (see the 491 <code class="module"><a href="/mod/mod_include.html">mod_include</a></code> documentation).</p> 492 </div> 493 494 <p>If the file specified by <code class="directive">HeaderName</code> contains 495 the beginnings of an HTML document (<html>, <head>, etc.) 496 then you will probably want to set <a href="#indexoptions.suppresshtmlpreamble"><code>IndexOptions 497 +SuppressHTMLPreamble</code></a>, so that these tags are not 498 repeated.</p> 499 500<h3>See also</h3> 501<ul> 502<li><code class="directive"><a href="#readmename">ReadmeName</a></code></li> 503</ul> 504</div> 505<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div> 506<div class="directive-section"><h2><a name="IndexHeadInsert" id="IndexHeadInsert">IndexHeadInsert</a> <a name="indexheadinsert" id="indexheadinsert">Directive</a></h2> 507<table class="directive"> 508<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Inserts text in the HEAD section of an index page.</td></tr> 509<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>IndexHeadInsert <var>"markup ..."</var></code></td></tr> 510<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr> 511<tr><th><a href="directive-dict.html#Override">Override:</a></th><td>Indexes</td></tr> 512<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Base</td></tr> 513<tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_autoindex</td></tr> 514</table> 515 <p>The <code class="directive">IndexHeadInsert</code> directive specifies a 516 string to insert in the <var><head></var> section of the HTML 517 generated for the index page.</p> 518 <pre class="prettyprint lang-config">IndexHeadInsert "<link rel=\"sitemap\" href=\"/sitemap.html\">"</pre> 519 520 521</div> 522<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div> 523<div class="directive-section"><h2><a name="IndexIgnore" id="IndexIgnore">IndexIgnore</a> <a name="indexignore" id="indexignore">Directive</a></h2> 524<table class="directive"> 525<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Adds to the list of files to hide when listing 526a directory</td></tr> 527<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>IndexIgnore <var>file</var> [<var>file</var>] ...</code></td></tr> 528<tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>IndexIgnore "."</code></td></tr> 529<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr> 530<tr><th><a href="directive-dict.html#Override">Override:</a></th><td>Indexes</td></tr> 531<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Base</td></tr> 532<tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_autoindex</td></tr> 533</table> 534 <p>The <code class="directive">IndexIgnore</code> directive adds to the 535 list of files to hide when listing a directory. <var>File</var> is a 536 shell-style wildcard expression or full 537 filename. Multiple IndexIgnore directives add 538 to the list, rather than the replacing the list of ignored 539 files. By default, the list contains <code>.</code> (the current 540 directory).</p> 541 542 <pre class="prettyprint lang-config">IndexIgnore .??* *~ *# HEADER* README* RCS CVS *,v *,t</pre> 543 544 545 <div class="note"><h3>Regular Expressions</h3> 546 <p>This directive does not currently work in configuration sections 547 that have regular expression arguments, such as <code class="directive"><a href="/mod/core.html#directorymatch"><DirectoryMatch></a></code> 548 </p> 549 </div> 550 551</div> 552<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div> 553<div class="directive-section"><h2><a name="IndexIgnoreReset" id="IndexIgnoreReset">IndexIgnoreReset</a> <a name="indexignorereset" id="indexignorereset">Directive</a></h2> 554<table class="directive"> 555<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Empties the list of files to hide when listing 556a directory</td></tr> 557<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>IndexIgnoreReset ON|OFF</code></td></tr> 558<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr> 559<tr><th><a href="directive-dict.html#Override">Override:</a></th><td>Indexes</td></tr> 560<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Base</td></tr> 561<tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_autoindex</td></tr> 562<tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>2.3.10 and later</td></tr> 563</table> 564 <p>The <code class="directive">IndexIgnoreReset</code> directive removes 565 any files ignored by <code class="directive">IndexIgnore</code> otherwise 566 inherited from other configuration sections. </p> 567 568 <pre class="prettyprint lang-config"><Directory /var/www> 569 IndexIgnore *.bak .??* *~ *# HEADER* README* RCS CVS *,v *,t 570</Directory> 571<Directory /var/www/backups> 572 IndexIgnoreReset ON 573 IndexIgnore .??* *# HEADER* README* RCS CVS *,v *,t 574</Directory></pre> 575 576 577 <div class="warning"><p> Review the default configuration for a list of 578 patterns that you might want to explicitly ignore after using this 579 directive.</p></div> 580 581</div> 582<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div> 583<div class="directive-section"><h2><a name="IndexOptions" id="IndexOptions">IndexOptions</a> <a name="indexoptions" id="indexoptions">Directive</a></h2> 584<table class="directive"> 585<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Various configuration settings for directory 586indexing</td></tr> 587<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>IndexOptions [+|-]<var>option</var> [[+|-]<var>option</var>] 588...</code></td></tr> 589<tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>By default, no options are enabled.</code></td></tr> 590<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr> 591<tr><th><a href="directive-dict.html#Override">Override:</a></th><td>Indexes</td></tr> 592<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Base</td></tr> 593<tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_autoindex</td></tr> 594</table> 595 <p>The <code class="directive">IndexOptions</code> directive specifies the 596 behavior of the directory indexing. <var>Option</var> can be one 597 of</p> 598 599 <dl> 600 <dt><a name="indexoptions.addaltclass" id="indexoptions.addaltclass">AddAltClass</a></dt> 601 <dd>Adds an additional CSS class declaration to each row of the 602 directory listing table when <code>IndexOptions HTMLTable</code> 603 is in effect and an <code>IndexStyleSheet</code> is defined. 604 Rather than the standard <code>even</code> and <code>odd</code> 605 classes that would otherwise be applied to each row of the table, 606 a class of <code>even-<em>ALT</em></code> or 607 <code>odd-<em>ALT</em></code> where <em>ALT</em> is either the 608 standard alt text associated with the file style (eg. <em>snd</em>, 609 <em>txt</em>, <em>img</em>, etc) or the alt text defined by one of 610 the various <code>AddAlt*</code> directives. 611 </dd> 612 613 <dt><a name="indexoptions.charset" id="indexoptions.charset">Charset=<var>character-set</var></a> (<em>Apache HTTP Server 2.0.61 and 614 later</em>)</dt> 615 616 <dd>The <code>Charset</code> keyword allows you to 617 specify the character set of the generated page. The 618 default is <code>UTF-8</code> on Windows and Mac OS X, 619 and <code>ISO-8859-1</code> elsewhere. 620 (It depends on whether the underlying file system 621 uses Unicode filenames or not.) 622 623 <pre class="prettyprint lang-config">IndexOptions Charset=UTF-8</pre> 624 625 </dd> 626 627 <dt><a name="indexoptions.descriptionwidth" id="indexoptions.descriptionwidth">DescriptionWidth=[<var>n</var> | *]</a></dt> 628 629 <dd>The <code>DescriptionWidth</code> keyword allows you to 630 specify the width of the description column in 631 characters.</dd> 632 633 <dd><code>-DescriptionWidth</code> (or unset) allows 634 <code class="module"><a href="/mod/mod_autoindex.html">mod_autoindex</a></code> to calculate the best width.</dd> 635 636 <dd><code>DescriptionWidth=<var>n</var></code> fixes the column width to 637 <var>n</var> bytes wide.</dd> 638 639 <dd><code>DescriptionWidth=*</code> grows the column to the 640 width necessary to accommodate the longest description 641 string.</dd> 642 643 <dd><strong>See the section on <code class="directive"><a href="#adddescription">AddDescription</a></code> for dangers 644 inherent in truncating descriptions.</strong></dd> 645 646 <dt><a name="indexoptions.fancyindexing" id="indexoptions.fancyindexing">FancyIndexing</a></dt> 647 648 <dd>This turns on fancy indexing of directories.</dd> 649 650 <dt><a name="indexoptions.foldersfirst" id="indexoptions.foldersfirst">FoldersFirst</a></dt> 651 652 <dd>If this option is enabled, subdirectory listings will 653 <em>always</em> appear first, followed by normal files in the 654 directory. The listing is basically broken into two 655 components, the files and the subdirectories, and each is 656 sorted separately and then displayed subdirectories-first. 657 For instance, if the sort order is descending by name, and 658 <code>FoldersFirst</code> is enabled, subdirectory 659 <code>Zed</code> will be listed before subdirectory 660 <code>Beta</code>, which will be listed before normal files 661 <code>Gamma</code> and <code>Alpha</code>. <strong>This option 662 only has an effect if <a href="#indexoptions.fancyindexing"><code>FancyIndexing</code></a> is also enabled.</strong></dd> 663 664 <dt><a name="indexoptions.htmltable" id="indexoptions.htmltable">HTMLTable</a></dt> 665 666 <dd>This option with <code>FancyIndexing</code> constructs 667 a simple table for the fancy directory listing. 668 It is necessary for utf-8 enabled platforms or if file 669 names or description text will alternate between 670 left-to-right and right-to-left reading order.</dd> 671 672 <dt><a name="indexoptions.iconsarelinks" id="indexoptions.iconsarelinks">IconsAreLinks</a></dt> 673 674 <dd>This makes the icons part of the anchor for the filename, for 675 fancy indexing.</dd> 676 677 <dt><a name="indexoptions.iconheight" id="indexoptions.iconheight">IconHeight[=<var>pixels</var>]</a></dt> 678 679 <dd>Presence of this option, when used with <code>IconWidth</code>, 680 will cause the server to include <code>height</code> and 681 <code>width</code> attributes in the <code>img</code> tag for the file 682 icon. This allows browser to precalculate the page layout without having 683 to wait until all the images have been loaded. If no value is given for 684 the option, it defaults to the standard height of the icons supplied 685 with the Apache httpd software.</dd> 686 687 <dt><a name="indexoptions.iconwidth" id="indexoptions.iconwidth">IconWidth[=<var>pixels</var>]</a></dt> 688 689 <dd>Presence of this option, when used with <code>IconHeight</code>, 690 will cause the server to include <code>height</code> and 691 <code>width</code> attributes in the <code>img</code> tag for 692 the file icon. This allows browser to precalculate the page 693 layout without having to wait until all the images have been 694 loaded. If no value is given for the option, it defaults to 695 the standard width of the icons supplied with the Apache httpd 696 software.</dd> 697 698 <dt><a name="indexoptions.ignorecase" id="indexoptions.ignorecase">IgnoreCase</a></dt> 699 700 <dd>If this option is enabled, names are sorted in a case-insensitive 701 manner. For instance, if the sort order is ascending by name, and 702 <code>IgnoreCase</code> is enabled, file Zeta will be listed after 703 file alfa (Note: file GAMMA will always be listed before file gamma). 704 </dd> 705 706 <dt><a name="indexoptions.ignoreclient" id="indexoptions.ignoreclient">IgnoreClient</a></dt> 707 708 <dd>This option causes <code class="module"><a href="/mod/mod_autoindex.html">mod_autoindex</a></code> to ignore all 709 query variables from the client, including sort order (implies 710 <code><a href="#indexoptions.suppresscolumnsorting">SuppressColumnSorting</a></code>.)</dd> 711 712 <dt><a name="indexoptions.namewidth" id="indexoptions.namewidth">NameWidth=[<var>n</var> 713 | *]</a></dt> 714 715 <dd>The <code>NameWidth</code> keyword allows you to specify the width 716 of the filename column in bytes.</dd> 717 718 <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, but only up 719 to 20 bytes wide.</dd> 720 721 <dd><code>NameWidth=<var>n</var></code> fixes the column width to 722 <var>n</var> bytes wide.</dd> 723 724 <dd><code>NameWidth=*</code> grows the column to the necessary 725 width.</dd> 726 727 <dt><a name="indexoptions.scanhtmltitles" id="indexoptions.scanhtmltitles">ScanHTMLTitles</a></dt> 728 729 <dd>This enables the extraction of the title from HTML documents 730 for fancy indexing. If the file does not have a description 731 given by <code class="directive"><a href="#adddescription">AddDescription</a></code> 732 then httpd will read the document for the value of the 733 <code>title</code> element. This is CPU and disk intensive.</dd> 734 735 <dt><a name="indexoptions.showforbidden" id="indexoptions.showforbidden">ShowForbidden</a></dt> 736 737 <dd>If specified, Apache httpd will show files normally hidden because 738 the subrequest returned <code>HTTP_UNAUTHORIZED</code> or 739 <code>HTTP_FORBIDDEN</code></dd> 740 741 <dt><a name="indexoptions.suppresscolumnsorting" id="indexoptions.suppresscolumnsorting">SuppressColumnSorting</a></dt> 742 743 <dd>If specified, Apache httpd will not make the column headings in a 744 FancyIndexed directory listing into links for sorting. The 745 default behavior is for them to be links; selecting the 746 column heading will sort the directory listing by the values 747 in that column. However, query string arguments which are appended 748 to the URL will still be honored. That behavior is controlled by <a href="#indexoptions.ignoreclient"><code>IndexOptions 749 IgnoreClient</code></a>.</dd> 750 751 <dt><a name="indexoptions.suppressdescription" id="indexoptions.suppressdescription">SuppressDescription</a></dt> 752 753 <dd>This will suppress the file description in fancy indexing 754 listings. By default, no file descriptions are defined, and 755 so the use of this option will regain 23 characters of screen 756 space to use for something else. See <code class="directive"><a href="#adddescription">AddDescription</a></code> for information about setting the file 757 description. See also the <code><a href="#indexoptions.descriptionwidth">DescriptionWidth</a></code> 758 index option to limit the size of the description column.</dd> 759 760 <dt><a name="indexoptions.suppresshtmlpreamble" id="indexoptions.suppresshtmlpreamble">SuppressHTMLPreamble</a></dt> 761 762 <dd>If the directory actually contains a file specified by the 763 <code class="directive"><a href="#headername">HeaderName</a></code> 764 directive, the module usually includes the contents of the file 765 after a standard HTML preamble (<code><html></code>, 766 <code><head></code>, <em>et cetera</em>). The 767 <code>SuppressHTMLPreamble</code> option disables this behaviour, 768 causing the module to start the display with the header file 769 contents. The header file must contain appropriate HTML instructions 770 in this case. If there is no header file, the preamble is generated 771 as usual. If you also specify a <code class="directive"><a href="#readmename">ReadmeName</a></code>, and if that file 772 exists, The closing </body></html> tags are also 773 ommitted from the output, under the assumption that you'll likely 774 put those closing tags in that file.</dd> 775 776 <dt><a name="indexoptions.suppressicon" id="indexoptions.suppressicon">SuppressIcon</a></dt> 777 778 <dd>This will suppress the icon in fancy indexing listings. 779 Combining both <code>SuppressIcon</code> and 780 <code>SuppressRules</code> yields proper HTML 3.2 output, which 781 by the final specification prohibits <code>img</code> and 782 <code>hr</code> elements from the <code>pre</code> block (used to 783 format FancyIndexed listings.)</dd> 784 785 <dt><a name="indexoptions.suppresslastmodified" id="indexoptions.suppresslastmodified">SuppressLastModified</a></dt> 786 787 <dd>This will suppress the display of the last modification date, 788 in fancy indexing listings.</dd> 789 790 <dt><a name="indexoptions.suppressrules" id="indexoptions.suppressrules">SuppressRules</a> 791 </dt> 792 793 <dd>This will suppress the horizontal rule lines (<code>hr</code> 794 elements) in directory listings. Combining both <code>SuppressIcon</code> and 795 <code>SuppressRules</code> yields proper HTML 3.2 output, which 796 by the final specification prohibits <code>img</code> and 797 <code>hr</code> elements from the <code>pre</code> block (used to 798 format FancyIndexed listings.)</dd> 799 800 <dt><a name="indexoptions.suppresssize" id="indexoptions.suppresssize">SuppressSize</a></dt> 801 802 <dd>This will suppress the file size in fancy indexing listings.</dd> 803 804 <dt><a name="indexoptions.trackmodified" id="indexoptions.trackmodified">TrackModified</a></dt> 805 806 <dd>This returns the <code>Last-Modified</code> and <code>ETag</code> 807 values for the listed directory in the HTTP header. It is only valid 808 if the operating system and file system return appropriate stat() 809 results. Some Unix systems do so, as do OS2's JFS and Win32's 810 NTFS volumes. OS2 and Win32 FAT volumes, for example, do not. 811 Once this feature is enabled, the client or proxy can track 812 changes to the list of files when they perform a <code>HEAD</code> 813 request. Note some operating systems correctly track new and 814 removed files, but do not track changes for sizes or dates of 815 the files within the directory. <strong>Changes to the size 816 or date stamp of an existing file will not update the 817 <code>Last-Modified</code> header on all Unix platforms.</strong> 818 If this is a concern, leave this option disabled.</dd> 819 820 <dt><a name="indexoptions.type" id="indexoptions.type">Type=<var>MIME content-type</var></a> (<em>Apache HTTP Server 2.0.61 and 821 later</em>)</dt> 822 823 <dd>The <code>Type</code> keyword allows you to 824 specify the MIME content-type of the generated page. The default 825 is <var>text/html</var>. 826 827 <pre class="prettyprint lang-config">IndexOptions Type=text/plain</pre> 828 829 </dd> 830 831 <dt><a name="indexoptions.versionsort" id="indexoptions.versionsort">VersionSort</a> 832 (<em>Apache HTTP Server 2.0a3 and later</em>)</dt> 833 834 <dd>The <code>VersionSort</code> keyword causes files containing 835 version numbers to sort in a natural way. Strings are sorted as 836 usual, except that substrings of digits in the name and 837 description are compared according to their numeric value. 838 839 <div class="example"><h3>Example:</h3><p><code> 840 foo-1.7<br /> 841 foo-1.7.2<br /> 842 foo-1.7.12<br /> 843 foo-1.8.2<br /> 844 foo-1.8.2a<br /> 845 foo-1.12 846 </code></p></div> 847 848 <p>If the number starts with a zero, then it is considered to 849 be a fraction:</p> 850 851 <div class="example"><p><code> 852 foo-1.001<br /> 853 foo-1.002<br /> 854 foo-1.030<br /> 855 foo-1.04 856 </code></p></div> 857 </dd> 858 859 <dt><a name="indexoptions.xhtml" id="indexoptions.xhtml">XHTML</a> 860 (<em>Apache HTTP Server 2.0.49 and later</em>)</dt> 861 862 <dd>The <code>XHTML</code> keyword forces <code class="module"><a href="/mod/mod_autoindex.html">mod_autoindex</a></code> 863 to emit XHTML 1.0 code instead of HTML 3.2.</dd> 864 865 </dl> 866 867 868 <dl><dt>Incremental IndexOptions</dt> 869 <dd> 870 <p>Be aware of how multiple <code class="directive">IndexOptions</code> are 871 handled.</p> 872 873 <ul> 874 <li>Multiple <code class="directive">IndexOptions</code> directives for a 875 single directory are now merged together. The result of: 876 877 <pre class="prettyprint lang-config"><Directory /foo> 878 IndexOptions HTMLTable 879 IndexOptions SuppressColumnsorting 880</Directory></pre> 881 882 883 <p>will be the equivalent of</p> 884 885 <pre class="prettyprint lang-config">IndexOptions HTMLTable SuppressColumnsorting</pre> 886 887 </li> 888 889 <li>The addition of the incremental syntax (<em>i.e.</em>, prefixing 890 keywords with <code>+</code> or <code>-</code>).</li> 891 </ul> 892 893 <p>Whenever a '+' or '-' prefixed keyword is encountered, it 894 is applied to the current <code class="directive">IndexOptions</code> 895 settings (which may have been inherited from an upper-level 896 directory). However, whenever an unprefixed keyword is processed, it 897 clears all inherited options and any incremental settings encountered 898 so far. Consider the following example:</p> 899 900 <pre class="prettyprint lang-config">IndexOptions +ScanHTMLTitles -IconsAreLinks FancyIndexing<br /> 901IndexOptions +SuppressSize</pre> 902 903 904 <p>The net effect is equivalent to <code>IndexOptions FancyIndexing 905 +SuppressSize</code>, because the unprefixed <code>FancyIndexing</code> 906 discarded the incremental keywords before it, but allowed them to 907 start accumulating again afterward.</p> 908 909 <p>To unconditionally set the <code class="directive">IndexOptions</code> for 910 a particular directory, clearing the inherited settings, specify 911 keywords without any <code>+</code> or <code>-</code> prefixes.</p> 912 </dd> 913 </dl> 914 915</div> 916<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div> 917<div class="directive-section"><h2><a name="IndexOrderDefault" id="IndexOrderDefault">IndexOrderDefault</a> <a name="indexorderdefault" id="indexorderdefault">Directive</a></h2> 918<table class="directive"> 919<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Sets the default ordering of the directory index</td></tr> 920<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>IndexOrderDefault Ascending|Descending 921Name|Date|Size|Description</code></td></tr> 922<tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>IndexOrderDefault Ascending Name</code></td></tr> 923<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr> 924<tr><th><a href="directive-dict.html#Override">Override:</a></th><td>Indexes</td></tr> 925<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Base</td></tr> 926<tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_autoindex</td></tr> 927</table> 928 <p>The <code class="directive">IndexOrderDefault</code> directive is used 929 in combination with the <code><a href="#indexoptions.fancyindexing">FancyIndexing</a></code> index option. By default, fancyindexed 930 directory listings are displayed in ascending order by filename; the 931 <code class="directive">IndexOrderDefault</code> allows you to change this 932 initial display order.</p> 933 934 <p><code class="directive">IndexOrderDefault</code> takes two 935 arguments. The first must be either <code>Ascending</code> or 936 <code>Descending</code>, indicating the direction of the sort. 937 The second argument must be one of the keywords <code>Name</code>, 938 <code>Date</code>, <code>Size</code>, or <code>Description</code>, 939 and identifies the primary key. The secondary key is 940 <em>always</em> the ascending filename.</p> 941 942 <p>You can, if desired, prevent the client from reordering the list 943 by also adding the <code><a href="#indexoptions.suppresscolumnsorting">SuppressColumnSorting</a></code> 944 index option to remove the sort link from the top of the column, 945 along with the <code><a href="#indexoptions.ignoreclient">IgnoreClient</a></code> index 946 option to prevent them from manually adding sort options to the 947 query string in order to override your ordering preferences.</p> 948 949</div> 950<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div> 951<div class="directive-section"><h2><a name="IndexStyleSheet" id="IndexStyleSheet">IndexStyleSheet</a> <a name="indexstylesheet" id="indexstylesheet">Directive</a></h2> 952<table class="directive"> 953<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Adds a CSS stylesheet to the directory index</td></tr> 954<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>IndexStyleSheet <var>url-path</var></code></td></tr> 955<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr> 956<tr><th><a href="directive-dict.html#Override">Override:</a></th><td>Indexes</td></tr> 957<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Base</td></tr> 958<tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_autoindex</td></tr> 959</table> 960 <p>The <code class="directive">IndexStyleSheet</code> directive sets the name of 961 the file that will be used as the CSS for the index listing. 962 </p> 963 <pre class="prettyprint lang-config">IndexStyleSheet "/css/style.css"</pre> 964 965 966 <p>Using this directive in conjunction with <code>IndexOptions 967 HTMLTable</code> adds a number of CSS classes to the resulting HTML. 968 The entire table is given a CSS id of <code>indexlist</code> and the 969 following classes are associated with the various parts of the 970 listing:</p> 971 972 <table class="bordered"><tr class="header"><th>Class</th><th>Definition</th></tr> 973<tr><td>tr.indexhead</td><td>Header row of listing</td></tr> 974<tr class="odd"><td>th.indexcolicon and td.indexcolicon</td> <td>Icon column</td></tr> 975<tr><td>th.indexcolname and td.indexcolname</td> <td>File name column</td></tr> 976<tr class="odd"><td>th.indexcollastmod and td.indexcollastmod</td> <td>Last modified column</td></tr> 977<tr><td>th.indexcolsize and td.indexcolsize</td> <td>File size column</td></tr> 978<tr class="odd"><td>th.indexcoldesc and td.indexcoldesc</td> <td>Description column</td></tr> 979<tr><td>tr.breakrow</td> <td>Horizontal rule at the bottom of the table</td></tr> 980<tr class="odd"><td>tr.odd and tr.even</td> <td>Alternating even and odd rows</td></tr> 981</table> 982 983 984</div> 985<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div> 986<div class="directive-section"><h2><a name="ReadmeName" id="ReadmeName">ReadmeName</a> <a name="readmename" id="readmename">Directive</a></h2> 987<table class="directive"> 988<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Name of the file that will be inserted at the end 989of the index listing</td></tr> 990<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ReadmeName <var>filename</var></code></td></tr> 991<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr> 992<tr><th><a href="directive-dict.html#Override">Override:</a></th><td>Indexes</td></tr> 993<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Base</td></tr> 994<tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_autoindex</td></tr> 995</table> 996 <p>The <code class="directive">ReadmeName</code> directive sets the name 997 of the file that will be appended to the end of the index 998 listing. <var>Filename</var> is the name of the file to include, and 999 is taken to be relative to the location being indexed. If 1000 <var>Filename</var> begins with a slash, as in example 2, it will be taken to be 1001 relative to the <code class="directive"><a href="/mod/core.html#documentroot">DocumentRoot</a></code>. 1002 </p> 1003 1004 <pre class="prettyprint lang-config"># Example 1 1005ReadmeName FOOTER.html</pre> 1006 1007 1008 <pre class="prettyprint lang-config"># Example 2 1009ReadmeName /include/FOOTER.html</pre> 1010 1011 1012 <p>See also <code class="directive"><a href="#headername">HeaderName</a></code>, where this behavior is described in greater 1013 detail.</p> 1014 1015</div> 1016</div> 1017<div class="bottomlang"> 1018<p><span>Available Languages: </span><a href="/en/mod/mod_autoindex.html" title="English"> en </a> | 1019<a href="/fr/mod/mod_autoindex.html" hreflang="fr" rel="alternate" title="Fran�ais"> fr </a> | 1020<a href="/ja/mod/mod_autoindex.html" hreflang="ja" rel="alternate" title="Japanese"> ja </a> | 1021<a href="/ko/mod/mod_autoindex.html" hreflang="ko" rel="alternate" title="Korean"> ko </a> | 1022<a href="/tr/mod/mod_autoindex.html" hreflang="tr" rel="alternate" title="T�rk�e"> tr </a></p> 1023</div><div class="top"><a href="#page-header"><img src="/images/up.gif" alt="top" /></a></div><div class="section"><h2><a id="comments_section" name="comments_section">Comments</a></h2><div class="warning"><strong>Notice:</strong><br />This is not a Q&A section. Comments placed here should be pointed towards suggestions on improving the documentation or server, and may be removed again by our moderators if they are either implemented or considered invalid/off-topic. Questions on how to manage the Apache HTTP Server should be directed at either our IRC channel, #httpd, on Freenode, or sent to our <a href="http://httpd.apache.org/lists.html">mailing lists</a>.</div> 1024<script type="text/javascript"><!--//--><![CDATA[//><!-- 1025var comments_shortname = 'httpd'; 1026var comments_identifier = 'http://httpd.apache.org/docs/2.4/mod/mod_autoindex.html'; 1027(function(w, d) { 1028 if (w.location.hostname.toLowerCase() == "httpd.apache.org") { 1029 d.write('<div id="comments_thread"><\/div>'); 1030 var s = d.createElement('script'); 1031 s.type = 'text/javascript'; 1032 s.async = true; 1033 s.src = 'https://comments.apache.org/show_comments.lua?site=' + comments_shortname + '&page=' + comments_identifier; 1034 (d.getElementsByTagName('head')[0] || d.getElementsByTagName('body')[0]).appendChild(s); 1035 } 1036 else { 1037 d.write('<div id="comments_thread">Comments are disabled for this page at the moment.<\/div>'); 1038 } 1039})(window, document); 1040//--><!]]></script></div><div id="footer"> 1041<p class="apache">Copyright 2014 The Apache Software Foundation.<br />Licensed under the <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache License, Version 2.0</a>.</p> 1042<p class="menu"><a href="/mod/">Modules</a> | <a href="/mod/directives.html">Directives</a> | <a href="http://wiki.apache.org/httpd/FAQ">FAQ</a> | <a href="/glossary.html">Glossary</a> | <a href="/sitemap.html">Sitemap</a></p></div><script type="text/javascript"><!--//--><![CDATA[//><!-- 1043if (typeof(prettyPrint) !== 'undefined') { 1044 prettyPrint(); 1045} 1046//--><!]]></script> 1047</body></html>