ディレクトリリストを有効にするには、Apacheでこれを使用します:
Options Indexes
DirectoryIndex index.html というディレクトリが要求されたときにApacheが提供するデフォルトファイルを含めます。
DirectoryIndex index.html
理想的には、これを仮想ホストごとに設定できます。私のvhostファイルは次のようになります:
ServerAdmin [email protected] DocumentRoot /some/path/ ... Options Indexes
DirectoryIndex ディレクティブを、ファイルシステム上でファイル名として決して出現しない値に設定することができます:
DirectoryIndex
ServerAdmin [email protected] DocumentRoot /some/path/ ... Options Indexes DirectoryIndex !
しかし、誰かが!という名前のファイルを追加すると、ディレクトリインデックスリストを表示する代わりにApacheによって提供されます。したがって、適切な解決策ではなく、奇妙な回避策があります。
!
DirectoryIndex disabled