Apache: Prevent Directory Browsing

Are web users able to browse the directories on your website and server and see all the files like folders with images in them and sub-folders? It may look something like this: Which you don’t want because it exposes your server to the public… It is easy to fix this and prevent people from browsing the directories on your website. You can do this with a simple .htaccess file in the root directory of your site. If there is an existing .htaccess file in the root folder of the site, you can edit it, else you can create a new one and put the following at the top of the .htaccess file: Options -Indexes That will sort the issue and by default it will tell the server to throw a 404 Not Found header instead of outputting the index of a...

Read More