David Riecks Photography


return to main Pictures words Links how to contact



Protect Folder Contents

If you have a folder of items in a public folder of your domain, and there is no "index.htm" or "index.html" file, the web server will, under most circumstances, reveal the entire contents of that directory, like this.

This makes it easy for those that want to "borrow" your content (images, graphics, etc) because they can get to them without having to view all of your pages.

You can prevent this from happening by simply placing an "index.htm" or "index.html" file in the folder. If you want to "gently escort" them to the front door of your web site use the code below the links. Just put your domain name where it says "yourdomain.com" in the code below and save it as a plaintext file (using notepad or simpletext) and title as either "index.html" or "index.htm" and place into the folder you want to protect.

  • See the "redirect" code in action by trying to view my images folder
  • Download "redirect" index.html code as a stuffit file.
<!doctype html public "-//w3c//dtd html 3.2//en">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta http-equiv="Refresh" content="0;URL=http://www.yourwebsite.com/index.html">
</head>
<body bgcolor="#FFFFFF">
</body>
</html>

copyright-info

This page last updated: March 2002
David Riecks