.htaccess Disable Apache Web Directory Listing: A Step Guide

By | September 4, 2020

If your web server is apache, when you open a directory by your browser, you may get a list of directories or files. Here is an example:

apache list directories and files

This is not safe to your site. In this tutorial, we will introduce how to make apache does not display directories and files.

Create or open a .htaccess file in your site root path

You can add code below at the end of this file.

Options All -Indexes

Then save this file.

You can find apache will not display display directories and files. This problem is fixed.

Leave a Reply

Your email address will not be published. Required fields are marked *