Prevent Directory Listing Using .htaccess

Create a .htaccess file by opening a new text document using notepad and saving it as “.htaccess”. must include the quotation marks so that notepad won’t give it an extension of .txt automatically. Or you can create a .txt file and rename it to .htacess

Add this words to your txt document.

Options -Indexes.

Then save.

And upload it to the directory you want to restrict listing.

This will prevent user from seeing all files on your web server directory.

By |2018-04-10T10:51:07+00:00March 11th, 2011|Tutorials, Web Designing|