Answers for "How do I disable directory browsing?"

1

deny directory listing htaccess

# Place the following in your .htaccess at doc root
Options -Indexes
Posted by: Guest on March-09-2020
0

How do I disable directory browsing?

This will disable directory listing from all folder that apache2 serves:

Open /etc/apache2/apache2.conf and change from this:

<Directory /var/www/>
        Options Indexes FollowSymLinks
        AllowOverride None
        Require all granted
</Directory>

to this:

<Directory /var/www/>
        Options FollowSymLinks
        AllowOverride None
        Require all granted
</Directory>

then restart apache by:
sudo service apache2 reload
Posted by: Guest on January-29-2021

Code answers related to "How do I disable directory browsing?"

Browse Popular Code Answers by Language