ApacheのIndexesが無効にならないとき

2021/07/14

ApacheのOptionsのIndexesを無効にしたい場合、うちの場合、VirtualHostディレクティブで、

    <Directory "/var/www/html/環境名">
        AllowOverride All
        Options +FollowSymLinks -Indexes
        DirectoryIndex index.php index.html
        Require all granted
    </Directory>

とすることが多いですが、/icons/でアクセスすると、なぜかIndexesが効いてしまい、表示されてしまうことがありました。

Apacheのほかの設定を見てみると、autoindex.confの中に、該当の設定があるみたいだったので、

#Alias /icons/ "/usr/share/httpd/icons/"
#
#<Directory "/usr/share/httpd/icons">
#    #Options Indexes MultiViews FollowSymlinks
#    Options MultiViews FollowSymlinks
#    AllowOverride None
#    Require all granted
#</Directory>

その該当箇所をコメントアウトすることで、/icons/も404ページに遷移するようになりました。

サニージェム公式note

アーカイブ記事

すべて
  • 1月
  • 2月
  • 3月
  • 4月
  • 5月
  • 6月
  • 7月
  • 8月
  • 9月
  • 10月
  • 11月
  • 12月

contact us お問い合わせ

Contact お問い合わせ・ご相談

「何から相談すればいいかわからない」
そんな段階でも、お気軽にご連絡ください。

Recruit 求人へのご応募

サニージェムの考え方に共感してくれる方と、
ぜひ一緒に働きたいと思っています。