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ページに遷移するようになりました。

contact us お問い合わせ

Contact お問い合わせ・ご相談

Webサービス・システム開発の
ご相談はお気軽にご連絡ください。

Recruit 求人へのご応募

サニージェムでは現在、プロジェクトの推進を
担う仲間を募集しています。