ディレクトリにindex.htmlなどのファイルがない場合、ディレクトリにアクセスされるとファイルの一覧が表示されてしまいます。
表示させないようにするには、httpd.confに変更を加えます。
<Directory "">
Options Indexes FollowSymLinks
</Directory>
Options Indexes FollowSymLinks
</Directory>
この「Options Indexes FollowSymLinks」のIndexesの前に「-」をつけます。
[変更後]
<Directory "">
Options -Indexes FollowSymLinks
</Directory>
Options -Indexes FollowSymLinks
</Directory>
[Apacheの再起動]
service httpd restart
これで一覧が見えなくなります。
人気記事一覧
- MySQL 最大の値・最新の日付データを1つ抽出する方法(MAX)
- [CakePHP] XformHelperの使い方
- Linux: スワップファイル(swp)の削除方法
- HTMLのForm methodとactionについて
- PHPでカンマ区切りデータを配列に入れる方法 (explode)
- [エラー対処] failed to open stream: No such file or directory
- [CSS]ブロック要素(div)の高さを、内部のfloat要素に合わせて自動調整する
- [vsftp] FileZillaから接続できない場合の対処法
- PHP5.1→PHP5.3へバージョンアップする方法(CentOS)
- PHPでテキストを1行ずつ読み込む方法(file_get_contents,explode)