Home PHP JavaScript CSS WordPress APIs .htaccess Other How-To Useful Scripts What I Recommend
Posted on by Aleksandar Gichevski ()
When u create website it is always necessary to protect your files and folders and show to users only what you want they to see. If you give them url from some example of file (image, document etc.), they can always edit the URL and list and view your other files in that directory even if you don’t want. With .htaccess we can simply disable that and prevent them to view specific directory. Preventing directory from viewing is very simple and requires only 1 line of code into the .htaccess file. With this protection user is able to view a specific document in that directory if he has direct url but he cannot view and list the directory that contains that file. To prevent specific directory from viewing create .htaccess file with the following line of code inside:
Options –Indexes
Then upload the created .htaccess file into the desired directory. After uploading open the directory in browser and you should see below screen message.


If you see 403 Permission Denied message it means that your .htaccess file works and you have successfully prevented your directory from viewing.

Other Posts You Might Like

Get a fast, free website audit

Enter your URL below to get full in-depth SEO report and tips.

Useful Scripts

Most Popular Posts

Recent Posts

June 14th, 2014
Website Optimization Using Gzip Compression

June 10th, 2014
Google Search AutoComplete API

May 14th, 2014
What is a Tag Cloud and How to Calculate it by Formula

March 27th, 2014
Error writing file /tmp (errcode 28) Solved!

February 15th, 2014
Fixed CSS & HTML Navigation Bar

February 9th, 2014
Benchmark Your Server (CPU, File IO, MySQL) with SysBench

February 8th, 2014
JavaScript Array Basics

January 29th, 2014

January 25th, 2014
Payoneer Debit Card for Freelancers to receive money online

January 24th, 2014
How HTML Color Codes are generated?

Read Latest Posts directly on Facebook