Thursday, July 10, 2008

The .htaccess file

I just learned how the .htaccess file is more than just specifying error pages. Here is a great link. It's a great introduction also if you have no idea what the .htaccess file is and provides sample code:

http://www.javascriptkit.com/howto/htaccess.shtml

It shows you how to:

  • Specify error pages
  • Stop directory browsing on your website. So that if you have an images folder, you “hide” it so that if people go to yourwebsite.com/images, they wont’ see a list of all your images
  • protect your .htaccess file
  • Stop hotlinking: so that people won’t link to your files and images and eat up your bandwidth
  • Ban bad bots that eat may crash you webserver!

This site has a few more sample codes/content for the .htaccess file: http://blog.dreamhosters.com/kbase/index.cgi?area=3083

No comments: