Stop thief

I’ve recently been playing around with some code to prevent hotlinking of the images on the site.

Hotlinking is when a page in one website displays an image served from another website.

It’s usually frowned upon as it uses the bandwidth of the server at the image’s website without giving credit to that website. In fact it’s sometimes called bandwidth theft, especially by webmasters who pay for bandwidth by the gigabyte – apart from the copyright issues, every time someone looks at an image stolen from your website, you have to pay to provide it. It’s like having someone steal your car and then getting you to pay for the petrol … forever!

It’s usually frowned on, that is, unless it’s Google doing it (or any one of a number of image search engines) in which case it’s a good thing, as Google does give credit to the host website and, more importantly, sends traffic to it.

Fortunately, it’s not too difficult to detect where an image is being displayed and, for any requests that come from unrecognised websites, substitute another picture. You can even give the bandwidth thieves a nasty surprise or warn off their potential customers.

I tried this approach for about a week recently, serving up the following, fairly innocuous image, instead of the one that had been requested:hotlink substitutionHowever, it isn’t always easy to tell which requests are benign (Google, Yahoo, etc) and which are not. For example, how about images sent in emails (which I can’t read).

So in the end I decided it was easier just to serve up the image as requested, but make sure it had “www.abcnotation.com/tunes” at the bottom as an indication of its source.

So now you know.

Chris

Tags: , , , ,

Comments are closed.