Previous: Installation

Next: Registration


Getting started with DeLeach:

Once you've installed DeLeach, you'll know it's working because - well, actually, you won't see any difference at all! In order to get DeLeach to work for you, you'll need to give it something to do.

What DeLeach does - the basics:

Without DeLeach in place, your web server sends files to anyone who asks. So, if the browser asks for /image.jpg, then the server will look for image.jpg in the root website folder. If the file is there, the server sends the contents back in reply. If the file isn't there, then it either sends a 404 (Page not found) error, or else it sends a special 404 page.

But, if the server can't find the file where it's been told to look for it, it will never look anywhere else for the file - just in the location that the browser has asked for.

Summary: Look for file thing.fil:

Without DeLeach: With DeLeach:
  • /thing.fil
  • 404 error
  • /thing.fil
  • /policy/thing.fil
  • /policy/#.fil
  • 404 error

DeLeach does something different. If the file is where the browser says it should be, it serves up the content, just like normal. (That's why your website can continue unchanged after you install DeLeach). But if the file isn't found, it looks for the file in a special subdirectory, caled the policy. If if finds it there, it serves that up. If still no joy, it serves up a template file from the policy directory. Only if all that fails will it serve up the 404 error.

An introduction to policies.

The policy is the key to making DeLeach work for you. When we talk about a DeLeach policy, we are actually refering to two different things:

(Normally, we'll talk just about the policy. But when we need to distinguish between the two different meanings, we'll talk about the policy directory or the policy rules.)

Every time a browser asks your webserver for a file (and the file isn't where it's supposed to be), DeLeach runs through its list of policy rules to select a policy. Then it looks in the corresponding policy directory, as described above.

You've got complete control over your policies. You can have as many different policies as you want, and you can put as many rules into each policy as you need. There are all sorts of things you can put into a policy rule: the IP address of the requesting server, the context of the request, the user-agent, even other rules! You can find out much more about configuring your policies here.

An example:

Let's put a basic website together, so you can see how it all fits. Let's suppose you have a website, called //you.com/, containing two files:

You have discovered that certain unscrupulous webmasters have included masterpiece.jpg directly into their pages. They're not only stealing your picture (and not attributing you), but they're also stealing your server bandwidth as well. (For more about bandwidth theft, see here.)

DeLeach to the rescue! Out of the box, DeLeach has a number of policies built-in. These include:

Step 1: Protect your masterpiece!

Create in your website the two directories _self and _def. Now move the file masterpeiece.jpg into _self. So your website now looks like this:

//you.com/
     index.htm
     _self/
          masterpiece.jpg
     _def/

Now, whenever anybody looks at //you.com/ this will happen:

The net result is that your website continues to behave normally. But what happens when badguy.com tries to use your picture?

The net result is that badguy.com just shows a little red cross instead of your picture.

Step 2: Throw them some bait!

Your masterpiece isn't a secret, is it? You want people to see your work, and you'd probably be grateful to badguy.com for the cheap publicity - if only it was publicising you and if only it was cheap.

So: start your image editing program. Make a smaller, low-resolution version of masterpiece.jpg, and add a burned-in credit (something like "Masterpiece © you.com. Visit us for the real thing!") Save it in _def/. Now, what happens when somebody visits //badguy.com/ is:

The net effect is that, for a small investment of bandwidth, every time somebody visits badguy.com, he shows your advert to them. Thanks, badguy!

Won't badguy know he's being tricked?

Perhaps. Perhaps not.

To be fair, he's not being tricked at all. He's using resources (your file, and your bandwidth) that don't belong to him. You could shut him out of your webserver altogether, remove the image, or change it to something else any time you like - and his website will break. What you're doing by setting up different policies is explicitly giving badguy - and others like him - permission to use your resources under specific conditions. You're using a technical solution to enforce your rights and your general licence terms.

This is one of the reasons why the free edition of DeLeach incorporates the watermark. It acts as a notice to would-be badguys that you have a deep-link fair-use licence in place.

That can be important, because, without such a notice, he might never know that he's been DeLeached! Most browsers try to cache as many files as they can, so they don't have to keep reloading them from the network - the browsers work much faster that way. So when badguy finds your website, he will download the _self version of masterpiece.jpg as normal. But when he looks at his own website, this will happen:

As far is badguy is concerned, nothing looks amiss - unless he shuts off his cache and reloads everything fresh each time.

I've got more than one directory in my website. How do I protect all my files?

Easy - put policy directories inside each directory you want to protect. Like this:

//you.com/
     index.htm
     _self/
          masterpiece.jpg
     _def/
          masterpiece.jpg (that's mini-masterpiece.jpg!)
     gallery/
          _self/
               <your protected stuff here>
          _def/
               <your free stuff here>

What if the browser asks for a file inside a policy directory? Won't my protected files be visible?

No they won't. DeLeach doesn't publish its own policy directories. So, asking for a file in a policy directory will be just the same as if DeLeach weren't installed and the policy directory didn't exist: a 404 error.

Do I need to restart IIS after I make changes to my policy file?

No. The policy file is as much a part of your website as your html files. Just make the changes, save, and you're done!