DEV Community

loading...

Disable directory listing on Apache server

Amit Verma (amitoverflow)
I am Amit a passionate web developer/designer and blogger from Shimla
・1 min read

While requesting a web directory , the listing of files and folders is called directory listing and it exposes your directory structure to clients. In this short article I will show you how we can disable directory browsing. To disable the listing of files and folders you can just use the following code in your htaccess


Options -Indexes

Enter fullscreen mode Exit fullscreen mode

This will return a 403 error when your directory is direct accessed.
Read the full tutorial here
https://helponnet.com/2021/07/29/apache-disable-directory-listing/

Discussion (0)