⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mod_autoindex.html

📁 这个是我在web培训时老师提供的手册
💻 HTML
📖 第 1 页 / 共 4 页
字号:
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<meta name="keywords" content="Apache, 中文, 手册, 中文版, 中文手册, 中文版手册, 参考手册, 中文参考手册, 金步国" />
<meta name="description" content="Apache 2.2 中文版参考手册" />
<meta name="author" content="金步国" />
<link href="../style/css/manual-zip.css" rel="stylesheet" media="all" type="text/css" title="Main stylesheet" />
<link href="../style/css/manual-zip-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" />
<title>mod_autoindex - Apache 2.2 中文版参考手册</title>
</head>
<body><div id="page-header">
<p class="menu"><a href="../mod/index.html">模块索引</a> | <a href="../mod/directives.html">指令索引</a> | <a href="../faq/index.html">常见问题</a> | <a href="../glossary.html">词汇表</a> | <a href="../sitemap.html">站点导航</a></p><p class="apache">Apache HTTP Server 版本2.2</p><img alt="" src="../images/feather.gif" /></div>
<div class="up"><a href="./index.html"><img title="&lt;-" alt="&lt;-" src="../images/left.gif" /></a></div>
<div id="path"><a href="http://www.apache.org/">Apache</a> &gt; <a href="http://httpd.apache.org/">HTTP Server</a> &gt; <a href="http://httpd.apache.org/docs/">文档</a> &gt; <a href="../index.html">版本2.2</a> &gt; <a href="./index.html">模块</a></div>

<div id="translation-info">   <a href="../translator_announcement.html#thanks">致谢</a> | <a href="../translator_announcement.html#announcement">译者声明</a> | 本篇译者:&lt;<a href="../translator_announcement.html#join">虚位以待</a>&gt; | 本篇译稿完成时间:?年?月?日 | <a href="../translator_announcement.html#last_new">获取最新版本</a></div>
<div id="page-content"><div id="preamble"><h1>Apache模块 mod_autoindex</h1>

<table border="1" cellpadding="0" cellspacing="0" bordercolor="#AAAAAA" class="module">
<tr><th><a href="module-dict.html#Description">说明</a></th><td>自动对目录中的内容生成列表,类似于"ls"或"dir"命令</td></tr>
<tr><th><a href="module-dict.html#Status">状态</a></th><td>基本(B)</td></tr>
<tr><th><a href="module-dict.html#ModuleIdentifier">模块名</a></th><td>autoindex_module</td></tr>
<tr><th><a href="module-dict.html#SourceFile">源文件</a></th><td>mod_autoindex.c</td></tr>
</table>
<h3>概述</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>和<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 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>
      &lt;form action="" method="get"&gt;<br />
      <span class="indent">
        Show me a &lt;select name="F"&gt;<br />
        <span class="indent">
          &lt;option value="0"&gt; Plain list&lt;/option&gt;<br />
          &lt;option value="1" selected="selected"&gt; Fancy list&lt;/option&gt;<br />
          &lt;option value="2"&gt; Table list&lt;/option&gt;<br />
        </span>
        &lt;/select&gt;<br />
        Sorted by &lt;select name="C"&gt;<br />
        <span class="indent">
          &lt;option value="N" selected="selected"&gt; Name&lt;/option&gt;<br />
          &lt;option value="M"&gt; Date Modified&lt;/option&gt;<br />
          &lt;option value="S"&gt; Size&lt;/option&gt;<br />
          &lt;option value="D"&gt; Description&lt;/option&gt;<br />
        </span>
        &lt;/select&gt;<br />
        &lt;select name="O"&gt;<br />
        <span class="indent">
          &lt;option value="A" selected="selected"&gt; Ascending&lt;/option&gt;<br />
          &lt;option value="D"&gt; Descending&lt;/option&gt;<br />
        </span>
        &lt;/select&gt;<br />
        &lt;select name="V"&gt;<br />
        <span class="indent">
          &lt;option value="0" selected="selected"&gt; in Normal order&lt;/option&gt;<br />
          &lt;option value="1"&gt; in Version order&lt;/option&gt;<br />
        </span>
        &lt;/select&gt;<br />
        Matching &lt;input type="text" name="P" value="*" /&gt;<br />
        &lt;input type="submit" name="X" value="Go" /&gt;<br />
      </span>
      &lt;/form&gt;
    </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">指令</a></h2>
<table border="1" cellpadding="0" cellspacing="0" bordercolor="#AAAAAA" class="directive">
<tr><th><a href="directive-dict.html#Description">说明</a></th><td>Alternate text to display for a file, instead of an
icon selected by filename</td></tr>
<tr><th><a href="directive-dict.html#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">作用域</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
<tr><th><a href="directive-dict.html#Override">覆盖项</a></th><td>Indexes</td></tr>
<tr><th><a href="directive-dict.html#Status">状态</a></th><td>基本(B)</td></tr>
<tr><th><a href="directive-dict.html#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>或<code>'</code>). This alternate text
    is displayed if the client is image-incapable, has image loading
    disabled, or fails to retrieve the icon.</p>

    <div class="example"><h3>例子</h3><p><code>
      AddAlt "PDF file" *.pdf<br />
      AddAlt Compressed *.gz *.zip *.Z
    </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="AddAltByEncoding" id="AddAltByEncoding">AddAltByEncoding</a> <a name="addaltbyencoding" id="addaltbyencoding">指令</a></h2>
<table border="1" cellpadding="0" cellspacing="0" bordercolor="#AAAAAA" class="directive">
<tr><th><a href="directive-dict.html#Description">说明</a></th><td>Alternate text to display for a file instead of an icon
selected by MIME-encoding</td></tr>
<tr><th><a href="directive-dict.html#Syntax">语法</a></th><td><code>AddAltByEncoding <var>string</var> <var>MIME-encoding</var>
[<var>MIME-encoding</var>] ...</code></td></tr>
<tr><th><a href="directive-dict.html#Context">作用域</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
<tr><th><a href="directive-dict.html#Override">覆盖项</a></th><td>Indexes</td></tr>
<tr><th><a href="directive-dict.html#Status">状态</a></th><td>基本(B)</td></tr>
<tr><th><a href="directive-dict.html#Module">模块</a></th><td>mod_autoindex</td></tr>
</table>
    <p><code class="directive">AddAltByEncoding</code> provides the alternate
    text to display for a file, instead of an icon, for <code><a href="#indexoptions.fancyindexing">FancyIndexing</a></code>.
    <var>MIME-encoding</var> is a valid content-encoding, such as
    <code>x-compress</code>. If <var>String</var> contains any whitespace,
    you have to enclose it in quotes (<code>"</code>或<code>'</code>).
    This alternate text is displayed if the client is image-incapable,

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -