📄 mod_autoindex.html.en
字号:
<p>If the file specified by <code class="directive">HeaderName</code> contains the beginnings of an HTML document (<html>, <head>, etc.) then you will probably want to set <a href="#indexoptions.suppresshtmlpreamble"><code>IndexOptions +SuppressHTMLPreamble</code></a>, so that these tags are not repeated.</p></div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div><div class="directive-section"><h2><a name="IndexHeadInsert" id="IndexHeadInsert">IndexHeadInsert</a> <a name="indexheadinsert" id="indexheadinsert">Directive</a></h2><table class="directive"><tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Inserts text in the HEAD section of an index page.</td></tr><tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>IndexHeadInsert <var>"markup ..."</var></code></td></tr><tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr><tr><th><a href="directive-dict.html#Override">Override:</a></th><td>Indexes</td></tr><tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Base</td></tr><tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_autoindex</td></tr></table> <p>The <code class="directive">IndexHeadInsert</code> directive specifies a string to insert in the <var><head></var> section of the HTML generated for the index page.</p> <div class="example"><h3>Example</h3><p><code> IndexHeadInsert "<link rel=\"sitemap\" href=\"/sitemap.html\">" </code></p></div></div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div><div class="directive-section"><h2><a name="IndexIgnore" id="IndexIgnore">IndexIgnore</a> <a name="indexignore" id="indexignore">Directive</a></h2><table class="directive"><tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Adds to the list of files to hide when listinga directory</td></tr><tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>IndexIgnore <var>file</var> [<var>file</var>] ...</code></td></tr><tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr><tr><th><a href="directive-dict.html#Override">Override:</a></th><td>Indexes</td></tr><tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Base</td></tr><tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_autoindex</td></tr></table> <p>The <code class="directive">IndexIgnore</code> directive adds to the list of files to hide when listing a directory. <var>File</var> is a shell-style wildcard expression or full filename. Multiple IndexIgnore directives add to the list, rather than the replacing the list of ignored files. By default, the list contains <code>.</code> (the current directory).</p> <div class="example"><p><code> IndexIgnore README .htaccess *.bak *~ </code></p></div></div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div><div class="directive-section"><h2><a name="IndexOptions" id="IndexOptions">IndexOptions</a> <a name="indexoptions" id="indexoptions">Directive</a></h2><table class="directive"><tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Various configuration settings for directoryindexing</td></tr><tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>IndexOptions [+|-]<var>option</var> [[+|-]<var>option</var>]...</code></td></tr><tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr><tr><th><a href="directive-dict.html#Override">Override:</a></th><td>Indexes</td></tr><tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Base</td></tr><tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_autoindex</td></tr></table> <p>The <code class="directive">IndexOptions</code> directive specifies the behavior of the directory indexing. <var>Option</var> can be one of</p> <dl> <dt><a name="indexoptions.charset" id="indexoptions.charset">Charset=<var>character-set</var></a> (<em>Apache 2.0.61 and later</em>)</dt> <dd>The <code>Charset</code> keyword allows you to specify the character set of the generated page. The default is either <var>ISO-8859-1</var> or <var>UTF-8</var>, depending on whether the underlying file system is unicode or not. <div class="example"><h3>Example:</h3><p><code> IndexOptions Charset=UTF-8 </code></p></div> </dd> <dt><a name="indexoptions.type" id="indexoptions.type">Type=<var>MIME content-type</var></a> (<em>Apache 2.0.61 and later</em>)</dt> <dd>The <code>Type</code> keyword allows you to specify the MIME content-type of the generated page. The default is <var>text/html</var>. <div class="example"><h3>Example:</h3><p><code> IndexOptions Type=text/plain </code></p></div> </dd> <dt><a name="indexoptions.descriptionwidth" id="indexoptions.descriptionwidth">DescriptionWidth=[<var>n</var> | *]</a> (<em>Apache 2.0.23 and later</em>)</dt> <dd>The <code>DescriptionWidth</code> keyword allows you to specify the width of the description column in characters.</dd> <dd><code>-DescriptionWidth</code> (or unset) allows <code class="module"><a href="../mod/mod_autoindex.html">mod_autoindex</a></code> to calculate the best width.</dd> <dd><code>DescriptionWidth=<var>n</var></code> fixes the column width to <var>n</var> bytes wide.</dd> <dd><code>DescriptionWidth=*</code> grows the column to the width necessary to accommodate the longest description string.</dd> <dd><strong>See the section on <code class="directive"><a href="#adddescription">AddDescription</a></code> for dangers inherent in truncating descriptions.</strong></dd> <dt><a name="indexoptions.fancyindexing" id="indexoptions.fancyindexing">FancyIndexing</a></dt> <dd>This turns on fancy indexing of directories.</dd> <dt><a name="indexoptions.foldersfirst" id="indexoptions.foldersfirst">FoldersFirst</a> (<em>Apache 2.0.23 and later</em>)</dt> <dd>If this option is enabled, subdirectory listings will <em>always</em> appear first, followed by normal files in the directory. The listing is basically broken into two components, the files and the subdirectories, and each is sorted separately and then displayed subdirectories-first. For instance, if the sort order is descending by name, and <code>FoldersFirst</code> is enabled, subdirectory <code>Zed</code> will be listed before subdirectory <code>Beta</code>, which will be listed before normal files <code>Gamma</code> and <code>Alpha</code>. <strong>This option only has an effect if <a href="#indexoptions.fancyindexing"><code>FancyIndexing</code></a> is also enabled.</strong></dd> <dt><a name="indexoptions.htmltable" id="indexoptions.htmltable">HTMLTable</a> (<em>Experimental, Apache 2.0.23 and later</em>)</dt> <dd>This experimental option with <code>FancyIndexing</code> constructs a simple table for the fancy directory listing. Note this will confuse older browsers. It is particularly necessary if file names or description text will alternate between left-to-right and right-to-left reading order, as can happen on WinNT or other utf-8 enabled platforms.</dd> <dt><a name="indexoptions.iconsarelinks" id="indexoptions.iconsarelinks">IconsAreLinks</a></dt> <dd>This makes the icons part of the anchor for the filename, for fancy indexing.</dd> <dt><a name="indexoptions.iconheight" id="indexoptions.iconheight">IconHeight[=<var>pixels</var>]</a></dt> <dd>Presence of this option, when used with <code>IconWidth</code>, will cause the server to include <code>height</code> and <code>width</code> attributes in the <code>img</code> tag for the file icon. This allows browser to precalculate the page layout without having to wait until all the images have been loaded. If no value is given for the option, it defaults to the standard height of the icons supplied with the Apache software.</dd> <dt><a name="indexoptions.iconwidth" id="indexoptions.iconwidth">IconWidth[=<var>pixels</var>]</a></dt> <dd>Presence of this option, when used with <code>IconHeight</code>, will cause the server to include <code>height</code> and <code>width</code> attributes in the <code>img</code> tag for the file icon. This allows browser to precalculate the page layout without having to wait until all the images have been loaded. If no value is given for the option, it defaults to the standard width of the icons supplied with the Apache software.</dd> <dt><a name="indexoptions.ignorecase" id="indexoptions.ignorecase">IgnoreCase</a></dt> <dd>If this option is enabled, names are sorted in a case-insensitive manner. For instance, if the sort order is ascending by name, and <code>IgnoreCase</code> is enabled, file Zeta will be listed after file alfa (Note: file GAMMA will always be listed before file gamma). </dd> <dt><a name="indexoptions.ignoreclient" id="indexoptions.ignoreclient">IgnoreClient</a></dt> <dd>This option causes <code class="module"><a href="../mod/mod_autoindex.html">mod_autoindex</a></code> to ignore all query variables from the client, including sort order (implies <code><a href="#indexoptions.suppresscolumnsorting">SuppressColumnSorting</a></code>.)</dd> <dt><a name="indexoptions.namewidth" id="indexoptions.namewidth">NameWidth=[<var>n</var> | *]</a></dt> <dd>The <code>NameWidth</code> keyword allows you to specify the width of the filename column in bytes.</dd> <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> <dd><code>NameWidth=<var>n</var></code> fixes the column width to <var>n</var> bytes wide.</dd> <dd><code>NameWidth=*</code> grows the column to the necessary width.</dd> <dt><a name="indexoptions.scanhtmltitles" id="indexoptions.scanhtmltitles">ScanHTMLTitles</a></dt> <dd>This enables the extraction of the title from HTML documents for fancy indexing. If the file does not have a description given by <code class="directive"><a href="#adddescription">AddDescription</a></code> then httpd will read the document for the value of the <code>title</code> element. This is CPU and disk intensive.</dd> <dt><a name="indexoptions.showforbidden" id="indexoptions.showforbidden">ShowForbidden</a></dt> <dd>If specified, Apache will show files normally hidden because the subrequest returned <code>HTTP_UNAUTHORIZED</code> or <code>HTTP_FORBIDDEN</code></dd> <dt><a name="indexoptions.suppresscolumnsorting" id="indexoptions.suppresscolumnsorting">SuppressColumnSorting</a></dt> <dd>If specified, Apache will not make the column headings in a FancyIndexed directory listing into links for sorting. The default behavior is for them to be links; selecting the column heading will sort the directory listing by the values in that column. <strong>Prior to Apache 2.0.23, this also disabled parsing the Query Arguments for the sort string.</strong> That behavior is now controlled by <a href="#indexoptions.ignoreclient"><code>IndexOptions IgnoreClient</code></a> in Apache 2.0.23.</dd> <dt><a name="indexoptions.suppressdescription" id="indexoptions.suppressdescription">SuppressDescription</a></dt> <dd>This will suppress the file description in fancy indexing listings. By default, no file descriptions are defined, and so the use of this option will regain 23 characters of screen space to use for something else. See <code class="directive"><a href="#adddescription">AddDescription</a></code> for information about setting the file description. See also the <code><a href="#indexoptions.descriptionwidth">DescriptionWidth</a></code> index option to limit the size of the description column.</dd> <dt><a name="indexoptions.suppresshtmlpreamble" id="indexoptions.suppresshtmlpreamble">SuppressHTMLPreamble</a></dt> <dd>If the directory actually contains a file specified by the <code class="directive"><a href="#headername">HeaderName</a></code> directive, the module usually includes the contents of the file after a standard HTML preamble (<code><html></code>,
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -