📄 mod_autoindex.html.en
字号:
<div class="example"><h3>Example</h3><p><code> HeaderName HEADER.html </code></p></div> <div class="note"> <p>Both HeaderName and <code class="directive"><a href="#readmename">ReadmeName</a></code> now treat <var>Filename</var> as a URI path relative to the one used to access the directory being indexed. If <var>Filename</var> begins 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> <div class="example"><h3>Example</h3><p><code> HeaderName /include/HEADER.html </code></p></div> <p><var>Filename</var> must resolve to a document with a major content type of <code>text/*</code> (<em>e.g.</em>, <code>text/html</code>, <code>text/plain</code>, etc.). This means that <var>filename</var> may refer to a CGI script if the script's actual file type (as opposed to its output) is marked as <code>text/html</code> such as with a directive like:</p> <div class="example"><p><code> AddType text/html .cgi </code></p></div> <p><a href="../content-negotiation.html">Content negotiation</a> will be performed if <code class="directive"><a href="../mod/core.html#options">Options</a></code> <code>MultiViews</code> is in effect. If <var>filename</var> resolves to a static <code>text/html</code> document (not a CGI script) and either one of the <code class="directive"><a href="../mod/core.html#options">options</a></code> <code>Includes</code> or <code>IncludesNOEXEC</code> is enabled, the file will be processed for server-side includes (see the <code class="module"><a href="../mod/mod_include.html">mod_include</a></code> documentation).</p> </div> <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="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 listing a 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 directory indexing</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.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 FancyIndexing 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 IconWidth, 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 IgnoreCase 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.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">IndexOptions IgnoreClient</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>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -