Directory browsing allows people to browse your websites files and folders, which can be a security risk.
Disabling directory browsing is better for your website security.
You can disable directory browsing by adding one line to your .htacces file (make sure your web server is configured to use .htaccess)
Edit your .htaccess file:
sudo nano /var/www/html/.htaccess
Add:
Options -Indexes
At the end
like so:
Thats all. Your website will now have directory browsing disabled
Issues
If anything goes wrong while trying this, or you have any questions regarding this tutorial, please leave a comment, and I’ll try to get back to you, or alternatively, leave a post on the forum.
No responses yet