mod_dir.xml.ja revision aded39829fe5f862c6c8095f42f7cc38e3407978
714c811200789fde839f46fe904db50b458afe1byoshiki<!DOCTYPE modulesynopsis SYSTEM "/style/modulesynopsis.dtd">
714c811200789fde839f46fe904db50b458afe1byoshiki<?xml-stylesheet type="text/xsl" href="/style/manual.ja.xsl"?>
4f32f36773e84a2ec9a930f85b44d31fc0c0c2cfigalic<!-- English Revision: 420990:1039209 (outdated) -->
031b91a62d25106ae69d4693475c79618dd5e884fielding Licensed to the Apache Software Foundation (ASF) under one or more
031b91a62d25106ae69d4693475c79618dd5e884fielding contributor license agreements. See the NOTICE file distributed with
031b91a62d25106ae69d4693475c79618dd5e884fielding this work for additional information regarding copyright ownership.
031b91a62d25106ae69d4693475c79618dd5e884fielding The ASF licenses this file to You under the Apache License, Version 2.0
031b91a62d25106ae69d4693475c79618dd5e884fielding (the "License"); you may not use this file except in compliance with
031b91a62d25106ae69d4693475c79618dd5e884fielding the License. You may obtain a copy of the License at
d5d794fc2f4cc9ca6d6da17cfa2cdcd8d244bacdnd Unless required by applicable law or agreed to in writing, software
d5d794fc2f4cc9ca6d6da17cfa2cdcd8d244bacdnd distributed under the License is distributed on an "AS IS" BASIS,
d5d794fc2f4cc9ca6d6da17cfa2cdcd8d244bacdnd WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
d5d794fc2f4cc9ca6d6da17cfa2cdcd8d244bacdnd See the License for the specific language governing permissions and
d5d794fc2f4cc9ca6d6da17cfa2cdcd8d244bacdnd limitations under the License.
208651a016b098f4fa1f6279559f104d70f1632dtakashi<description>「最後のスラッシュ」のリダイレクトと、ディレクトリの
208651a016b098f4fa1f6279559f104d70f1632dtakashiインデックスファイルを扱う機能を提供する</description>
208651a016b098f4fa1f6279559f104d70f1632dtakashi <li>一つ目は、ユーザが作成したファイルを用いるもので、通常
208651a016b098f4fa1f6279559f104d70f1632dtakashi <directive module="mod_dir">DirectoryIndex</directive> ディレクティブで
208651a016b098f4fa1f6279559f104d70f1632dtakashi モジュールで提供されます。</li>
208651a016b098f4fa1f6279559f104d70f1632dtakashi <li>もう一つの方法は、
208651a016b098f4fa1f6279559f104d70f1632dtakashi サーバによって自動的に生成されるディレクトリリストを用いる場合です。
208651a016b098f4fa1f6279559f104d70f1632dtakashi モジュールにより提供されます。</li>
208651a016b098f4fa1f6279559f104d70f1632dtakashi <p>自動的なインデックス生成機能を削除 (もしくは交換)
208651a016b098f4fa1f6279559f104d70f1632dtakashi できるように、この二つの機能は分離されています。</p>
208651a016b098f4fa1f6279559f104d70f1632dtakashi <p>なお <code>http://servername/foo/dirname</code> という URL
208651a016b098f4fa1f6279559f104d70f1632dtakashi というディレクトリがあれば、「最後にスラッシュをつけた形」の URL
208651a016b098f4fa1f6279559f104d70f1632dtakashi へのリダイレクトを送出します。
208651a016b098f4fa1f6279559f104d70f1632dtakashi ディレクトリへのアクセスはスラッシュで終わっている必要があり、
208651a016b098f4fa1f6279559f104d70f1632dtakashi <code>mod_dir</code> は、<code>http://servername/foo/dirname/</code>
208651a016b098f4fa1f6279559f104d70f1632dtakashi へのリダイレクトを送出することになります。</p>
714c811200789fde839f46fe904db50b458afe1byoshiki<directivesynopsis>
208651a016b098f4fa1f6279559f104d70f1632dtakashi<description>クライアントがディレクトリをリクエストしたときに調べる
208651a016b098f4fa1f6279559f104d70f1632dtakashiリソースのリスト</description>
714c811200789fde839f46fe904db50b458afe1byoshiki<syntax>DirectoryIndex
5feb3e793f498910da27b70e591fc021e378e44byoshiki <var>local-url</var> [<var>local-url</var>] ...</syntax>
5feb3e793f498910da27b70e591fc021e378e44byoshiki<contextlist><context>server config</context><context>virtual host</context>
5feb3e793f498910da27b70e591fc021e378e44byoshiki<context>directory</context><context>.htaccess</context></contextlist>
208651a016b098f4fa1f6279559f104d70f1632dtakashi クライアントが、ディレクトリ名の最後に「/」
208651a016b098f4fa1f6279559f104d70f1632dtakashi を指定してディレクトリインデックスを要求する場合に探すリソースのリストを
208651a016b098f4fa1f6279559f104d70f1632dtakashi <directive>DirectoryIndex</directive> ディレクティブで設定します。
208651a016b098f4fa1f6279559f104d70f1632dtakashi は、リクエストされたディレクトリに対応する、サーバ上のドキュメントの
208651a016b098f4fa1f6279559f104d70f1632dtakashi (% エンコードされた) URL で、普通はディレクトリ中のファイルの名前です。
208651a016b098f4fa1f6279559f104d70f1632dtakashi 複数の URL が設定された場合には、最初に見つかったものを返します。
208651a016b098f4fa1f6279559f104d70f1632dtakashi オプションがセットされている場合、ディレクトリのリストを生成します。
5feb3e793f498910da27b70e591fc021e378e44byoshiki DirectoryIndex index.html
208651a016b098f4fa1f6279559f104d70f1632dtakashi が存在すれば、この URL が返されます。
208651a016b098f4fa1f6279559f104d70f1632dtakashi もし存在しなければ、ディレクトリのリストが返されます。</p>
208651a016b098f4fa1f6279559f104d70f1632dtakashi <p>注: ドキュメントが同じディレクトリ内に存在するは必要ありません。
5feb3e793f498910da27b70e591fc021e378e44byoshiki DirectoryIndex index.html index.txt /cgi-bin/index.pl
208651a016b098f4fa1f6279559f104d70f1632dtakashi <p>とした場合、<code>index.html</code> と <code>index.txt</code>
208651a016b098f4fa1f6279559f104d70f1632dtakashi のどちらもディレクトリ内に存在しない場合、CGI スクリプト
714c811200789fde839f46fe904db50b458afe1byoshiki</directivesynopsis>
7e0a407d2f853301306a2f33c955128e49011137kawai<directivesynopsis>
208651a016b098f4fa1f6279559f104d70f1632dtakashi<description>パス末尾のスラッシュでリダイレクトするかどうかのオンオフをトグルさせる</description>
7e0a407d2f853301306a2f33c955128e49011137kawai<contextlist><context>server config</context><context>virtual host</context>
7e0a407d2f853301306a2f33c955128e49011137kawai<context>directory</context><context>.htaccess</context></contextlist>
208651a016b098f4fa1f6279559f104d70f1632dtakashi <p>要求のあった URL がディレクトリを指すかどうかを、
208651a016b098f4fa1f6279559f104d70f1632dtakashi ディレクティブで設定します。</p>
208651a016b098f4fa1f6279559f104d70f1632dtakashi <p>典型的には、ユーザが末尾のスラッシュ無しでリソースへのリクエストを発行し、
208651a016b098f4fa1f6279559f104d70f1632dtakashi この挙動には幾つか理由があります:</p>
208651a016b098f4fa1f6279559f104d70f1632dtakashi <li><module>mod_autoindex</module> が期待通りに動く。<module>mod_autoindex</module>
208651a016b098f4fa1f6279559f104d70f1632dtakashi の生成するリンクはパスを出力しませんので、スラッシュがない場合は間違ったパスを
208651a016b098f4fa1f6279559f104d70f1632dtakashi 指してしまうことになります。</li>
208651a016b098f4fa1f6279559f104d70f1632dtakashi <li><directive module="mod_dir">DirectoryIndex</directive> は、
208651a016b098f4fa1f6279559f104d70f1632dtakashi <p>とはいえ、もしこういった効果を望まない、かつ、
208651a016b098f4fa1f6279559f104d70f1632dtakashi 上記のような理由が当てはまらない場合は、リダイレクトを次のようにしてオフにできます:</p>
7e0a407d2f853301306a2f33c955128e49011137kawai # see security warning below!<br />
7e0a407d2f853301306a2f33c955128e49011137kawai DirectorySlash Off<br />
7e0a407d2f853301306a2f33c955128e49011137kawai SetHandler some-handler<br />
7e0a407d2f853301306a2f33c955128e49011137kawai </Location>
208651a016b098f4fa1f6279559f104d70f1632dtakashi <p>末尾のスラッシュでのリダイレクトをオフにすると、結果的に情報漏洩を
208651a016b098f4fa1f6279559f104d70f1632dtakashi 招くことになるかもしれません。
208651a016b098f4fa1f6279559f104d70f1632dtakashi <module>mod_autoindex</module> が有効 (<code>Options +Indexes</code>) で、
208651a016b098f4fa1f6279559f104d70f1632dtakashi <directive module="mod_dir">DirectoryIndex</directive> が有効なリソース (例えば
208651a016b098f4fa1f6279559f104d70f1632dtakashi ハンドラが設定されていない場合を考えてみてください。
208651a016b098f4fa1f6279559f104d70f1632dtakashi この場合末尾にスラッシュのついているリクエストに対しては <code>index.html</code>
208651a016b098f4fa1f6279559f104d70f1632dtakashi ファイルが返されます。<strong>しかしスラッシュのないリクエストに対しては、
7e0a407d2f853301306a2f33c955128e49011137kawai</directivesynopsis>
aded39829fe5f862c6c8095f42f7cc38e3407978rbowen<directivesynopsis>
aded39829fe5f862c6c8095f42f7cc38e3407978rbowen<description>Define a default URL for requests that don't map to a file</description>
aded39829fe5f862c6c8095f42f7cc38e3407978rbowen<contextlist><context>server config</context><context>virtual host</context><context>directory</context><context>.htaccess</context></contextlist>
aded39829fe5f862c6c8095f42f7cc38e3407978rbowen<usage>Documentation not yet translated. Please see English version of document.</usage>
aded39829fe5f862c6c8095f42f7cc38e3407978rbowen</directivesynopsis>
714c811200789fde839f46fe904db50b458afe1byoshiki</modulesynopsis>