Prevent Directory Listing

Image from Hosting Services: Prevent Directory Listing

Whenever you have folders with large amounts of files or important administration files, it is essential to prevent directory listings, otherwise all of the files in the folder will be listed to anyone who wants to see them, including hackers. When hackers can find an administration file, it makes their job a little easier. Now that a hacker has found the admin login page, all they have to do is "crack the safe". To prevent this from occuring, disable directory listing.

Start out by opening your .htaccess file or create a new one. (If you are new to .htaccess files, please read the Introduction to .htaccess files tutorial to find out how to use and create .htaccess files.)

In your .htaccess file, add the following to the next available line.

IndexIgnore *

(The * is known as a wildcard and means all files.)

Sometimes you may want to exclude the listing of files with certain extensions. To do this, use the following line. (You may change .gif and/or .jpg to any format you would like to exclude. You may also add as many formats to the list as you would like to exclude.)

IndexIgnore *.gif *.jpg

Congratulations! Your site is now more secure from curious hackers trying to take over your site and its files.


Related Articles

  • How The Yahoo! Directory Really Ranks Its Directory Listings
    In this article, I show you how the Yahoo! Directory ranks its listings, so you can use this knowledge to get higher rankings. First you must ...
  • No Direct Linking
    If you want to prevent those awful direct linkers, use this tutorial. Open up your notepad (start>>programs>>accessories>>notepad) or another text editor, and copy the code below to it. Name this file .htaccess and make sure it doesnt have an extension on the end, like .txt. If i....
  • How To Select The Best Category When Submitting To Web Directories
    In this article I show you how to select the best category when submitting to a web directory, to give your site every chance of achieving top rankings for th...
  • Read This Before you Submit to Web Directories
    This excellent article raises all the necessary questions that you should know about before submitting your website to web directories.
  • Prevent Right-clicking
    If you dont want your visitors to rightclick at your page, you can insert this code somewhere between and . Type in the message you want your visitors to get in the line Write your message here
  • Is Dmoz Listing A Test Of Patience?
    Dmoz is always viewed as the key to get higher traffic and increased PageRank for your website. Webmasters and online business owners aim for a Dmoz listing with the faith that it can help their sites rank well on the search engines especially in Google - since Google uses the information contained ...
  • Search Engine or Directory?
    Here is an article well worth the read. When you need to get your website indexed for improved SEO it helps to understand the differences and relative values of listings between Search Engines and Directories. Very good info.
  • Introduction to .htaccess
    .htaccess is a Unix/Linux based file for Apache web servers that allow you to change access permissions and many other things for files on your web server.
    To make a .htaccess file, open up an html editor, preferably notepad, and enter your commands(each on a seperate line). When saving your file...
  • Creating a Robots.txt file
    Some people believe that they should create different pages for different search engines, each page optimized for one keyword and for one search engine. Now, if you do decide to create such pages, there is one issue that you need to be aware of...
  • How Google Indexes Content From Directories
    In a fluke, I was able to notice something about the way Google indexes content from web directories. Excluding your template, the most important line of code is the first title you add to your main body.

Contact Web Design Outsource and get started today

Need Website Designing, Development, Redesigning, Maintenance and SEO services or help growing your company's web presence? Request a free Quote Now.