1 <?xml version=
"1.0" encoding=
"UTF-8"?>
2 <!DOCTYPE html PUBLIC
"-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
3 <html xmlns=
"http://www.w3.org/1999/xhtml" lang=
"ja" xml:
lang=
"ja"><head><!--
4 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
5 This file is generated from xml source: DO NOT EDIT
6 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
8 <title>mod_dir - Apache HTTP サーバ
</title>
9 <link href=
"../style/css/manual.css" rel=
"stylesheet" media=
"all" type=
"text/css" title=
"Main stylesheet" />
10 <link href=
"../style/css/manual-loose-100pc.css" rel=
"alternate stylesheet" media=
"all" type=
"text/css" title=
"No Sidebar - Default font size" />
11 <link href=
"../style/css/manual-print.css" rel=
"stylesheet" media=
"print" type=
"text/css" />
12 <link href=
"../images/favicon.ico" rel=
"shortcut icon" /></head>
14 <div id=
"page-header">
15 <p class=
"menu"><a href=
"../mod/">モジュール
</a> |
<a href=
"../mod/directives.html">ディレクティブ
</a> |
<a href=
"../faq/">FAQ
</a> |
<a href=
"../glossary.html">用語
</a> |
<a href=
"../sitemap.html">サイトマップ
</a></p>
16 <p class=
"apache">Apache HTTP サーバ バージョン
2.3</p>
17 <img alt=
"" src=
"../images/feather.gif" /></div>
18 <div class=
"up"><a href=
"./"><img title=
"<-" alt=
"<-" src=
"../images/left.gif" /></a></div>
20 <a href=
"http://www.apache.org/">Apache
</a> > <a href=
"http://httpd.apache.org/">HTTP サーバ
</a> > <a href=
"http://httpd.apache.org/docs/">ドキュメンテーション
</a> > <a href=
"../">バージョン
21 2.3</a> > <a href=
"./">モジュール
</a></div>
22 <div id=
"page-content">
23 <div id=
"preamble"><h1>Apache モジュール mod_dir
</h1>
25 <p><span>言語:
</span><a href=
"../en/mod/mod_dir.html" hreflang=
"en" rel=
"alternate" title=
"English"> en
</a> |
26 <a href=
"../ja/mod/mod_dir.html" title=
"Japanese"> ja
</a> |
27 <a href=
"../ko/mod/mod_dir.html" hreflang=
"ko" rel=
"alternate" title=
"Korean"> ko
</a> |
28 <a href=
"../tr/mod/mod_dir.html" hreflang=
"tr" rel=
"alternate" title=
"Türkçe"> tr
</a></p>
30 <div class=
"outofdate">この日本語訳はすでに古くなっている可能性があります。
31 更新された内容を見るには英語版をご覧下さい。
</div>
32 <table class=
"module"><tr><th><a href=
"module-dict.html#Description">説明:
</a></th><td>「最後のスラッシュ」のリダイレクトと、ディレクトリの
33 インデックスファイルを扱う機能を提供する
</td></tr>
34 <tr><th><a href=
"module-dict.html#Status">ステータス:
</a></th><td>Base
</td></tr>
35 <tr><th><a href=
"module-dict.html#ModuleIdentifier">モジュール識別子:
</a></th><td>dir_module
</td></tr>
36 <tr><th><a href=
"module-dict.html#SourceFile">ソースファイル:
</a></th><td>mod_dir.c
</td></tr></table>
39 <p>ディレクトリインデックスは、次の二つのうちどちらかが利用されます:
</p>
42 <li>一つ目は、ユーザが作成したファイルを用いるもので、通常
43 <code>index.html
</code> というファイル名を使います。このファイル名は、
44 <code class=
"directive"><a href=
"#directoryindex">DirectoryIndex
</a></code> ディレクティブで
45 指定することができます。この機能は
<code class=
"module"><a href=
"../mod/mod_dir.html">mod_dir
</a></code>
49 サーバによって自動的に生成されるディレクトリリストを用いる場合です。
50 この機能は、
<code class=
"module"><a href=
"../mod/mod_autoindex.html">mod_autoindex
</a></code>
54 <p>自動的なインデックス生成機能を削除 (もしくは交換)
55 できるように、この二つの機能は分離されています。
</p>
57 <p>なお
<code>http://servername/foo/dirname
</code> という URL
58 へのリクエストがあった際に、
<code>dirname
</code>
59 というディレクトリがあれば、「最後にスラッシュをつけた形」の URL
61 ディレクトリへのアクセスはスラッシュで終わっている必要があり、
62 <code>mod_dir
</code> は、
<code>http://servername/foo/dirname/
</code>
63 へのリダイレクトを送出することになります。
</p>
65 <div id=
"quickview"><h3 class=
"directives">ディレクティブ
</h3>
67 <li><img alt=
"" src=
"../images/down.gif" /> <a href=
"#directoryindex">DirectoryIndex
</a></li>
68 <li><img alt=
"" src=
"../images/down.gif" /> <a href=
"#directoryslash">DirectorySlash
</a></li>
72 <div class=
"top"><a href=
"#page-header"><img alt=
"top" src=
"../images/up.gif" /></a></div>
73 <div class=
"directive-section"><h2><a name=
"DirectoryIndex" id=
"DirectoryIndex">DirectoryIndex
</a> <a name=
"directoryindex" id=
"directoryindex">ディレクティブ
</a></h2>
74 <table class=
"directive">
75 <tr><th><a href=
"directive-dict.html#Description">説明:
</a></th><td>クライアントがディレクトリをリクエストしたときに調べる
77 <tr><th><a href=
"directive-dict.html#Syntax">構文:
</a></th><td><code>DirectoryIndex
78 <var>local-url
</var> [
<var>local-url
</var>] ...
</code></td></tr>
79 <tr><th><a href=
"directive-dict.html#Default">デフォルト:
</a></th><td><code>DirectoryIndex index.html
</code></td></tr>
80 <tr><th><a href=
"directive-dict.html#Context">コンテキスト:
</a></th><td>サーバ設定ファイル, バーチャルホスト, ディレクトリ, .htaccess
</td></tr>
81 <tr><th><a href=
"directive-dict.html#Override">上書き:
</a></th><td>Indexes
</td></tr>
82 <tr><th><a href=
"directive-dict.html#Status">ステータス:
</a></th><td>Base
</td></tr>
83 <tr><th><a href=
"directive-dict.html#Module">モジュール:
</a></th><td>mod_dir
</td></tr>
86 クライアントが、ディレクトリ名の最後に「/」
87 を指定してディレクトリインデックスを要求する場合に探すリソースのリストを
88 <code class=
"directive">DirectoryIndex
</code> ディレクティブで設定します。
90 は、リクエストされたディレクトリに対応する、サーバ上のドキュメントの
91 (% エンコードされた) URL で、普通はディレクトリ中のファイルの名前です。
92 複数の URL が設定された場合には、最初に見つかったものを返します。
93 それらが見つからず、
<code>Indexes
</code>
94 オプションがセットされている場合、ディレクトリのリストを生成します。
97 <div class=
"example"><h3>例
</h3><p><code>
98 DirectoryIndex index.html
101 <p><code>http://myserver/docs/
</code> へのアクセスがあり、
102 <code>http://myserver/docs/index.html
</code>
103 が存在すれば、この URL が返されます。
104 もし存在しなければ、ディレクトリのリストが返されます。
</p>
106 <p>注: ドキュメントが同じディレクトリ内に存在するは必要ありません。
109 <div class=
"example"><p><code>
110 DirectoryIndex index.html index.txt /cgi-bin/index.pl
113 <p>とした場合、
<code>index.html
</code> と
<code>index.txt
</code>
114 のどちらもディレクトリ内に存在しない場合、CGI スクリプト
115 <code>/cgi-bin/index.pl
</code> が実行されます。
</p>
118 <div class=
"top"><a href=
"#page-header"><img alt=
"top" src=
"../images/up.gif" /></a></div>
119 <div class=
"directive-section"><h2><a name=
"DirectorySlash" id=
"DirectorySlash">DirectorySlash
</a> <a name=
"directoryslash" id=
"directoryslash">ディレクティブ
</a></h2>
120 <table class=
"directive">
121 <tr><th><a href=
"directive-dict.html#Description">説明:
</a></th><td>パス末尾のスラッシュでリダイレクトするかどうかのオンオフをトグルさせる
</td></tr>
122 <tr><th><a href=
"directive-dict.html#Syntax">構文:
</a></th><td><code>DirectorySlash On|Off
</code></td></tr>
123 <tr><th><a href=
"directive-dict.html#Default">デフォルト:
</a></th><td><code>DirectorySlash On
</code></td></tr>
124 <tr><th><a href=
"directive-dict.html#Context">コンテキスト:
</a></th><td>サーバ設定ファイル, バーチャルホスト, ディレクトリ, .htaccess
</td></tr>
125 <tr><th><a href=
"directive-dict.html#Override">上書き:
</a></th><td>Indexes
</td></tr>
126 <tr><th><a href=
"directive-dict.html#Status">ステータス:
</a></th><td>Base
</td></tr>
127 <tr><th><a href=
"directive-dict.html#Module">モジュール:
</a></th><td>mod_dir
</td></tr>
128 <tr><th><a href=
"directive-dict.html#Compatibility">互換性:
</a></th><td>2.0.51 以降
</td></tr>
130 <p>要求のあった URL がディレクトリを指すかどうかを、
131 <code class=
"module"><a href=
"../mod/mod_dir.html">mod_dir
</a></code> が調整するべきかどうかを
132 <code class=
"directive">DirectorySlash
</code>
135 <p>典型的には、ユーザが末尾のスラッシュ無しでリソースへのリクエストを発行し、
136 そして、そのリソースがディレクトリを指していた場合、
<code class=
"module"><a href=
"../mod/mod_dir.html">mod_dir
</a></code>
137 は、末尾にスラッシュを
<em>付加
</em>した上で同じリソースにリダイレクトさせます。
138 この挙動には幾つか理由があります:
</p>
141 <li>ユーザは、最終的にはリソースの別名 URL をリクエストすることになる。
</li>
142 <li><code class=
"module"><a href=
"../mod/mod_autoindex.html">mod_autoindex
</a></code> が期待通りに動く。
<code class=
"module"><a href=
"../mod/mod_autoindex.html">mod_autoindex
</a></code>
143 の生成するリンクはパスを出力しませんので、スラッシュがない場合は間違ったパスを
145 <li><code class=
"directive"><a href=
"#directoryindex">DirectoryIndex
</a></code> は、
146 末尾にスラッシュがついているリクエストについて
<em>のみ
</em>評価される。
</li>
147 <li>HTML ページの相対 URL 参照が正しく動作する。
</li>
150 <p>とはいえ、もしこういった効果を望まない、かつ、
151 上記のような理由が当てはまらない場合は、リダイレクトを次のようにしてオフにできます:
</p>
153 <div class=
"example"><p><code>
154 # see security warning below!
<br />
155 <Location /some/path
><br />
156 <span class=
"indent">
157 DirectorySlash Off
<br />
158 SetHandler some-handler
<br />
163 <div class=
"warning"><h3>セキュリティ警告
</h3>
164 <p>末尾のスラッシュでのリダイレクトをオフにすると、結果的に情報漏洩を
166 <code class=
"module"><a href=
"../mod/mod_autoindex.html">mod_autoindex
</a></code> が有効 (
<code>Options +Indexes
</code>) で、
167 <code class=
"directive"><a href=
"#directoryindex">DirectoryIndex
</a></code> が有効なリソース (例えば
168 <code>index.html
</code>) を指していて、また、要求のあった URL に特別な
169 ハンドラが設定されていない場合を考えてみてください。
170 この場合末尾にスラッシュのついているリクエストに対しては
<code>index.html
</code>
171 ファイルが返されます。
<strong>しかしスラッシュのないリクエストに対しては、
172 ディレクトリの内容一覧を返してしまいます。
</strong></p>
177 <div class=
"bottomlang">
178 <p><span>言語:
</span><a href=
"../en/mod/mod_dir.html" hreflang=
"en" rel=
"alternate" title=
"English"> en
</a> |
179 <a href=
"../ja/mod/mod_dir.html" title=
"Japanese"> ja
</a> |
180 <a href=
"../ko/mod/mod_dir.html" hreflang=
"ko" rel=
"alternate" title=
"Korean"> ko
</a> |
181 <a href=
"../tr/mod/mod_dir.html" hreflang=
"tr" rel=
"alternate" title=
"Türkçe"> tr
</a></p>
182 </div><div id=
"footer">
183 <p class=
"apache">Copyright
2009 The Apache Software Foundation.
<br />Licensed under the
<a href=
"http://www.apache.org/licenses/LICENSE-2.0">Apache License, Version
2.0</a>.
</p>
184 <p class=
"menu"><a href=
"../mod/">モジュール
</a> |
<a href=
"../mod/directives.html">ディレクティブ
</a> |
<a href=
"../faq/">FAQ
</a> |
<a href=
"../glossary.html">用語
</a> |
<a href=
"../sitemap.html">サイトマップ
</a></p></div>