📄 mod_autoindex.html.en
字号:
<?xml version="1.0" encoding="ISO-8859-1"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"><head><!-- XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX This file is generated from xml source: DO NOT EDIT XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX --><title>mod_autoindex - Apache HTTP Server</title><link href="../style/css/manual.css" rel="stylesheet" media="all" type="text/css" title="Main stylesheet" /><link href="../style/css/manual-loose-100pc.css" rel="alternate stylesheet" media="all" type="text/css" title="No Sidebar - Default font size" /><link href="../style/css/manual-print.css" rel="stylesheet" media="print" type="text/css" /><link href="../images/favicon.ico" rel="shortcut icon" /></head><body><div id="page-header"><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><p class="apache">Apache HTTP Server Version 2.0</p><img alt="" src="../images/feather.gif" /></div><div class="up"><a href="./"><img title="<-" alt="<-" src="../images/left.gif" /></a></div><div id="path"><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.0</a> > <a href="./">Modules</a></div><div id="page-content"><div id="preamble"><h1>Apache Module mod_autoindex</h1><div class="toplang"><p><span>Available Languages: </span><a href="../en/mod/mod_autoindex.html" title="English"> en </a> |<a href="../ja/mod/mod_autoindex.html" hreflang="ja" rel="alternate" title="Japanese"> ja </a> |<a href="../ko/mod/mod_autoindex.html" hreflang="ko" rel="alternate" title="Korean"> ko </a></p></div><table class="module"><tr><th><a href="module-dict.html#Description">Description:</a></th><td>Generates directory indexes, automatically, similar to the Unix <code>ls</code> command or the Win32 <code>dir</code> shell command</td></tr><tr><th><a href="module-dict.html#Status">Status:</a></th><td>Base</td></tr><tr><th><a href="module-dict.html#ModuleIdentifier">Module營dentifier:</a></th><td>autoindex_module</td></tr><tr><th><a href="module-dict.html#SourceFile">Source燜ile:</a></th><td>mod_autoindex.c</td></tr></table><h3>Summary</h3> <p>The index of a directory can come from one of two sources:</p> <ul> <li>A file written by the user, typically called <code>index.html</code>. The <code class="directive"><a href="../mod/mod_dir.html#directoryindex">DirectoryIndex</a></code> directive sets the name of this file. This is controlled by <code class="module"><a href="../mod/mod_dir.html">mod_dir</a></code>.</li> <li>Otherwise, a listing generated by the server. The other 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 <code class="directive"><a href="#addiconbytype">AddIconByType</a></code> are used to set a list of icons to display for various file types; for each file listed, the first icon listed that matches the file is displayed. These are controlled by <code class="module"><a href="../mod/mod_autoindex.html">mod_autoindex</a></code>.</li> </ul> <p>The two functions are separated so that you can completely remove (or replace) automatic index generation should you want to.</p> <p>Automatic index generation is enabled with using <code>Options +Indexes</code>. See the <code class="directive"><a href="../mod/core.html#options">Options</a></code> directive for more details.</p> <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, the column headers are links that control the order of the display. If you select a header link, the listing will be regenerated, sorted by the values in that column. Selecting the same header repeatedly toggles between ascending and descending order. These column header links are suppressed with <code class="directive"><a href="#indexoptions">IndexOptions</a></code> directive's <code>SuppressColumnSorting</code> option.</p> <p>Note that when the display is sorted by "Size", it's the <em>actual</em> size of the files that's used, not the displayed value - so a 1010-byte file will always be displayed before a 1011-byte file (if in ascending order) even though they both are shown as "1K".</p></div><div id="quickview"><h3 class="directives">Directives</h3><ul id="toc"><li><img alt="" src="../images/down.gif" /> <a href="#addalt">AddAlt</a></li><li><img alt="" src="../images/down.gif" /> <a href="#addaltbyencoding">AddAltByEncoding</a></li><li><img alt="" src="../images/down.gif" /> <a href="#addaltbytype">AddAltByType</a></li><li><img alt="" src="../images/down.gif" /> <a href="#adddescription">AddDescription</a></li><li><img alt="" src="../images/down.gif" /> <a href="#addicon">AddIcon</a></li><li><img alt="" src="../images/down.gif" /> <a href="#addiconbyencoding">AddIconByEncoding</a></li><li><img alt="" src="../images/down.gif" /> <a href="#addiconbytype">AddIconByType</a></li><li><img alt="" src="../images/down.gif" /> <a href="#defaulticon">DefaultIcon</a></li><li><img alt="" src="../images/down.gif" /> <a href="#headername">HeaderName</a></li><li><img alt="" src="../images/down.gif" /> <a href="#indexignore">IndexIgnore</a></li><li><img alt="" src="../images/down.gif" /> <a href="#indexoptions">IndexOptions</a></li><li><img alt="" src="../images/down.gif" /> <a href="#indexorderdefault">IndexOrderDefault</a></li><li><img alt="" src="../images/down.gif" /> <a href="#readmename">ReadmeName</a></li></ul><h3>Topics</h3><ul id="topics"><li><img alt="" src="../images/down.gif" /> <a href="#query">Autoindex Request Query Arguments</a></li></ul></div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div><div class="section"><h2><a name="query" id="query">Autoindex Request Query Arguments</a></h2> <p>Apache 2.0.23 reorganized the Query Arguments for Column Sorting, and introduced an entire group of new query options. To effectively eliminate all client control over the output, the <code><a href="#indexoptions.ignoreclient">IndexOptions IgnoreClient</a></code> option was introduced.</p> <p>The column sorting headers themselves are self-referencing hyperlinks that add the sort query options shown below. Any option below may be added to any request for the directory resource.</p> <ul> <li><code>C=N</code> sorts the directory by file name</li> <li><code>C=M</code> sorts the directory by last-modified date, then file name</li> <li><code>C=S</code> sorts the directory by size, then file name</li> <li class="separate"><code>C=D</code> sorts the directory by description, then file name</li> <li><code>O=A</code> sorts the listing in Ascending Order</li> <li class="separate"><code>O=D</code> sorts the listing in Descending Order</li> <li><code>F=0</code> formats the listing as a simple list (not FancyIndexed)</li> <li><code>F=1</code> formats the listing as a FancyIndexed list</li> <li class="separate"><code>F=2</code> formats the listing as an HTMLTable FancyIndexed list</li> <li><code>V=0</code> disables version sorting</li> <li class="separate"><code>V=1</code> enables version sorting</li> <li><code>P=<var>pattern</var></code> lists only files matching the given <var>pattern</var></li> </ul> <p>Note that the 'P'attern query argument is tested <em>after</em> the usual <code class="directive"><a href="#indexignore">IndexIgnore</a></code> directives are processed, and all file names are still subjected to the same criteria as any other autoindex listing. The Query Arguments parser in <code class="module"><a href="../mod/mod_autoindex.html">mod_autoindex</a></code> will stop abruptly when an unrecognized option is encountered. The Query Arguments must be well formed, according to the table above.</p> <p>The simple example below, which can be clipped and saved in a header.html file, illustrates these query options. Note that the unknown "X" argument, for the submit button, is listed last to assure the arguments are all parsed before mod_autoindex encounters the X=Go input.</p> <div class="example"><p><code> <form action="" method="get"><br /> <span class="indent"> Show me a <select name="F"><br /> <span class="indent"> <option value="0"> Plain list</option><br /> <option value="1" selected="selected"> Fancy list</option><br /> <option value="2"> Table list</option><br /> </span> </select><br /> Sorted by <select name="C"><br /> <span class="indent"> <option value="N" selected="selected"> Name</option><br /> <option value="M"> Date Modified</option><br /> <option value="S"> Size</option><br /> <option value="D"> Description</option><br /> </span> </select><br /> <select name="O"><br /> <span class="indent"> <option value="A" selected="selected"> Ascending</option><br /> <option value="D"> Descending</option><br /> </span> </select><br /> <select name="V"><br /> <span class="indent"> <option value="0" selected="selected"> in Normal order</option><br /> <option value="1"> in Version order</option><br /> </span> </select><br /> Matching <input type="text" name="P" value="*" /><br /> <input type="submit" name="X" value="Go" /><br /> </span> </form> </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="AddAlt" id="AddAlt">AddAlt</a> <a name="addalt" id="addalt">Directive</a></h2><table class="directive"><tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Alternate text to display for a file, instead of anicon selected by filename</td></tr><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><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><code class="directive">AddAlt</code> provides the alternate text to display for a file, instead of an icon, for <code><a href="#indexoptions.fancyindexing">FancyIndexing</a></code>. <var>File</var> is a file extension, partial filename, wild-card expression or full filename for files to describe. If <var>String</var> contains any whitespace, you have to enclose it in quotes (<code>"</code> or <code>'</code>). This alternate text is displayed if the client is image-incapable, has image loading disabled, or fails to retrieve the icon.</p>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -