No of visitors who read this post: 252
Category: Chat/IM
Type: Question
No votes yet

Hi,

Hw can i prevent the listing of the directory? In my accessible folder, I do not have an index file and when i access through a browser its contents are listed. What is the best solution to my problem?

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

#

Hi Dear,

If you want to create a new director (folder) on your website and did not put an “index.html” file in it. You may be surprised to know that your visitors can get a directory listing of all the files in that folder. For example: If you create a folder called “Incoming”. You can see everything in that directory by simply typing http://www.example.com/incoming/ in your browser. No password or anything is needed.

Perequiisites.

  • You website must be on an Apache web server
  • You web host must have Enabled HT Access Server Override

First Solution

  • Following Steps to do for preventing a Directory Listing
  • Get your existing HT Access File (If any)
  • Make a backup of the HT Access File
  • Create or open this HT Access file
  • Disable Indexing
  • Saving and uploading the File
  • Test you website

Second Solution

  • You can control this behavior of your website by using one simple line
  • Option +Indexes
  • The above line enables director listing
  • Option -Indexes
  • The above line disables director listing for your website
  • The HT Access file gives more than simply enabling and disabling of directory listings
  • The HT Access file you can control which files to be ignored when creating a directory list
  • For Example,
  • Index ignored: *.gif, *.zip, *.txt
  • Will make the apache server to skill all fig, zip and txt files from the directory list.
  • Convenient, isn’t it.
  • Index ignore *
  • Will just create an empty director list

Hope these solution are helpful for you.