One thing that I've seen over and over again in code that I download or review online is the use of .inc files. These handy files, while nothing more than a extensions of the document, can be harmful to your site if they fall on the wrong hands. Thankfully, Jason from PHPComplete has written a little tutorial aimed at helping with just that.
Problem: You used files with the extension of .inc, and now you want to stop people from viewing them.
Solution: There are three possible solutions - use an .htaccess, change them to .php files, or move them out of the document root for your web server.
All three are good, practical examples, and should be a serious consideration for anyone that has used .inc files on their sites, or is planning to. And remember, there is no "one best solution". These three examples are just that - examples. There's always hundreds of ways to do things, so work with it, figure out what works best for your site, and go with it. As long as you're not opening up new security holes, you be doing just fine...




