How To Stop Hot Linking
Last Updated on Monday, 7 November 2011 06:05 Written by a2e Friday, 3 April 2009 08:06
Hot linking - someone displays your images on their web site or another site like EBay as an example. This wasts your bandwidth and that can be bad enough but for shops and auctions it could hold a big danger. These people could be using your images to scam people or because they are too idle to make their own images to advertise items, on EBay for example. You may be thinking well even if I stop them hot linking they can always download the images to use them. NOTE – For product images we’ll go into watermarking marking in another post ;-)
One way to prevent hot linking is to add some text to your .htacces file. All servers have this file and if you don’t know what it does then think of it as a sort of index file in a filing cabinet having all the rules to follow when looking inside the cabinet.
You can set up your .htaccess file to actually serve up different content when hot linking occurs. This is more commonly done with images, such as serving up an Angry Man image in place of the hot linked one. The code for this is:
RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://(www.)?myauction.com/.*$ [NC]
RewriteRule .(gif|jpg|js|css)$ - [F]
But how about making the crime a bit more obvious to the perpitrator ?
Swap the wanted image for one of your choice using the code below;
RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://(www.)?myauction.com/.*$ [NC]
RewriteRule .(gif|jpg)$ http://www.myauction.com/angry.gif [R,L]

Try linking to this image

You'll get this one :-)
Same deal- replace myauction.com with your own, plus angry.gif.




















