How to protect your web directories

Published on December 27, 2007   By Ram  7 Comments  

I just saw a post on Life Rocks 2.0 which explains you to how to protect your wordpress theme files. It is possible for any one to see your wordpress theme files or plugin folders to see what themes you are using or what plugins you use if you don’t protect them.

What you do to protect, one method is to follow above linked post, but the problem is what to do when you have many directories with out index.html files. In this case adding a simple rule to your .htaccess will solve the problem.

Simply add “Options -Indexes” to your .htaccess file, so whenever try to open any directory on your webserver with out index.html file will show a 403 error page. With this one rule you can save lot of time in creating index.html files to each directory.

htaccess options indexes

This only works with Apache Webserver. Read more about Options indexes.

Survey: Take our survey and win $100 VISA Card

Subscribe to RSS or via Email to get daily updates.

Comments

7 Responses to “How to protect your web directories”
  1. Nirmal says:

    Thanks for the mention and the htaccess rule is the best one I guess, but people with less experience in htaccess may find it difficult.

  2. kanak says:

    thanks Ram for this. I added that .html file before. I thot of searching the htaccess rule but before that you posted this. Thanks for sharing this simple trick. I added this too in my htaccess file.

  3. Haris says:

    I played with the htaccess only once. will see if I can do it myself or will ask for help from you! :D

  4. Ram says:

    @Nirmal,
    ur right for inexperienced users it may be difficult to play with htaccess.
    @Kanak
    You are welcome
    @Haris
    You are welcome, don’t hesitate to contact me if you need any help.

  5. Syahid A. says:

    Easy, useful and quick tip. Just what I need.

  6. Ram says:

    @Syahid
    Glad that it is useful for you

Leave a Comment