Apache 2.0手册中文版翻译项目

项目说明 | 项目进度 | 项目讨论区 | Apache手册中文版

 


mod_dir - Apache HTTP服务器
<-
Apache主站 > HTTP服务器 > 文档 > 2.0版本 > 模块索引

Apache模块 mod_dir


现有的语种:  en  |  ja  |  ko 

说明:Provides for "trailing slash" redirects and serving directory index files
状态:Base
模块名:dir_module
源文件:mod_dir.c

概要

The index of a directory can come from one of two sources:

The two functions are separated so that you can completely remove (or replace) automatic index generation should you want to.

A "trailing slash" redirect is issued when the server receives a request for a URL http://servername/foo/dirname where dirname is a directory. Directories require a trailing slash, so mod_dir issues a redirect to http://servername/foo/dirname/.

指令索引

top

DirectoryIndex 指令

说明:List of resources to look for when the client requests a directory
语法:DirectoryIndex local-url [local-url] ...
默认值:DirectoryIndex index.html
上下文:服务器配置, 虚拟主机, 目录, .htaccess
覆盖项:Indexes
状态:Base
模块:mod_dir

The DirectoryIndex directive sets the list of resources to look for, when the client requests an index of the directory by specifying a / at the end of the a directory name. Local-url is the (%-encoded) URL of a document on the server relative to the requested directory; it is usually the name of a file in the directory. Several URLs may be given, in which case the server will return the first one that it finds. If none of the resources exist and the Indexes option is set, the server will generate its own listing of the directory.

Example

DirectoryIndex index.html

then a request for http://myserver/docs/ would return http://myserver/docs/index.html if it exists, or would list the directory if it did not.

Note that the documents do not need to be relative to the directory;

DirectoryIndex index.html index.txt /cgi-bin/index.pl

would cause the CGI script /cgi-bin/index.pl to be executed if neither index.html or index.txt existed in a directory.

现有的语种:  en  |  ja  |  ko 

 


项目维护者: kajaa

项目说明 | 项目进度 | 项目讨论区 | Apache手册中文版