Protecting Images from Hotlinking with a WatermarkGeneral » Websites | By Ali Watters June 21st 2005 |
One of the biggest problems with running a website is the use of your material without attribution. I run two websites where photography is a large part - Jeber.com and travelblog.org.What is Hotlinking?Hotlinking is the practice of using an image hosted on one website in another. Most commonly this is done without attribution (giving the owner of the image credit for the image), without permission - and to be fair most web users don't realise that it is very bad practice - technically it breaks copyright - but as a webmaster that is the least of the problem, the main problem is the leeching of bandwidth, additional load on the webserver, add to this - visitors to the page don't even know where the image comes from. Protection by watermarkingSome websites watermark all their images, placing a transparent image over the top of the original image before publishing on the web. This is a solution, but a drastic one, images don't look as good with a watermark. Here is a solution that provides a solution that works in many ways: Images that are on your site - show unwatermarked. Images that are hotlinked - lower the quality and add a watermark, your site logo and address for example. How to protect your imagesBy combining a number of tools, most importantly mod_rewrite, imagemagick and a little scripting you can create a generic protection for your images that also has the added advantage of being a little advert for your site every time it's hotlinked. (If bandwidth is the major concern - use -F to forbid the images in the .htaccess file.) Well with no further ado - here is the code and the instructions: <?php And to show it in practice - here is an image hotlinked from travelblog.org: ![]() Options: Contact Ali Watters Code: [blog=4] | |