Deny Directory Listing in .htaccess

Some webmasters upload a blank index.html for dont index directories. Thats a way of listing directories. But htaccess is more easier solution for this. Just add this code to your .htaccess file

Options -Indexes

Allow directory index, remove the that code or change

Options +Indexes

If you want to list files in directory, but except some of filetypes. Example this code is ignoring zip and rar files.

IndexIgnore *.zip *.rar

 You can disable directory indexing with indexignore too

IndexIgnore *

 Another way is changing the directory index file

DirectoryIndex this_my_index_file.html

Share and Enjoy:
  • StumbleUpon
  • Digg
  • TwitThis
  • FriendFeed
  • del.icio.us
  • MySpace
  • Technorati
  • Facebook
  • Google Bookmarks
  • Live

Enjoy this article?

Consider subscribing to our RSS feed!

Share us Facebook, FriendFeed, Digg

Liked by

This website uses IntenseDebate comments, but they are not currently loaded because either your browser doesn't support JavaScript, or they didn't load fast enough.

No Comments

No comments yet.

Sorry, the comment form is closed at this time.

Oyun