htaccess - block access to a certain file type

Posted on 2009-04-21
Last Modified: 2012-06-27
Hi all,

I would like to block access to a certain file type on my site.  I know it's bad practice but I *do* have a few .bak, .edit, files dotted around important directories, especially those with public content.  These of course are not parsed by the site and can be read by anyone.

Can anyone point me to a decent link explaining this?

Ideally the htaccess file should apply to all subdirectories below it.  Otherwise I'll have to enter it at each directory level.  This is fine, but I bet there is better way.

Many Thanks
Question by:chriscounter07
    1 Comment

    Accepted Solution


    Featured Post

    6 Surprising Benefits of Threat Intelligence

    All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

    Join & Write a Comment

    Suggested Solutions

    Problem to be resolved in this article Currently, development of website and web application can be done without writing thousands of lines of programming code by hand. Description This can be done through by using a open source framework such …
    Author Note: Since this E-E article was originally written, years ago, formal testing has come into common use in the world of PHP.  PHPUnit ( and similar technologies have enjoyed wide adoption, making it possib…
    This tutorial walks through the best practices in adding a local business to Google Maps including how to properly search for duplicates, marker placement, and inputing business details. Login to your Google Account, then search for "Google Mapmaker…
    The viewer will learn how to dynamically set the form action using jQuery.

    732 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    23 Experts available now in Live!

    Get 1:1 Help Now