Leeched Image vs Normal Image    Sex Sells: A Note on Image Leeching

Every now and then somebody invents a web site which uses images from other people's web sites as part of their content. They enjoy the benefits of the traffic (for example, advertising revenue), while the image owner ends up paying for the bandwidth. This is called image leeching.

What can you, as a web site owner, do about this?

If you're running a good web server, like Apache, then you can block all requests to images from browsers which specify a referring site other than your own. In your .htaccess file, you can add a rewrite rule something like this:

RewriteCond %{HTTP_REFERER} !^$                                  
RewriteCond %{HTTP_REFERER} !^https?://www.example.com/.*$ [NC]
RewriteRule .*\.gif$        -                            [F]

This forces all requests for .gif files to fail ([F]) if the page in which the image is embedded (given to us as the Referer: (sic) in the HTTP request) is neither blank nor matches www.example.com. Refer to the Apache URL Rewriting Guide for more details.

Alternatively, if you are hosted by a hosting provider like ours (which has excellent bandwidth costs and limits), then you can might wish to have a little innocent fun at the other web site's expense.

For example, you could have arrived at this page because you clicked on an icon which included the word Sex on it which you saw at the site IconSurf.com. Strangely enough, that's not our normal icon. (We don't have any XXX content so our normal icon is rather boring). We looked at where you were coming from in our .htaccess file, and chose whether to give you the more interesting version:

# Give iconsuf.com visitors something more interesting
# Note: due to a bug they often ask for //favicon.ico instead of /favicon.ico
RewriteBase /
RewriteCond %{HTTP_REFERER} iconsurf [NC]
RewriteRule favicon\.ico$ sex_sells.ico [L]
Then, when you arrived, we re-directed you to this page:
# Note the checks for the rewritten URI to prevent looping
RewriteCond %{HTTP_REFERER} iconsurf [NC]
RewriteCond %{REQUEST_URI} !^/sex_sells.ico$
RewriteCond %{REQUEST_URI} !/disaster/sex_sells.php
RewriteRule !favicon\.ico$ http://www.albionresearch.com/disaster/sex_sells.php [R,L]

Alternatively, you could have arrived at this page because a naïve search engine misclassified this page under the term "sex image". Tempting as it is to redirect such traffic to a more alluring location, I've just made some small changes to the text if this is the case.

With this combination of techniques, you can display what you like on the other site's page and, if they link to you, redirect any inbound traffic to the page of your choice.

Other tips and tools for webmasters.


© Albion Research Ltd. 2018