Hot Link Protection is a Must When on a Cloud Server
| By Matt Dunlap on June 25th, 2010 | 1 comment |

These hot links are OK
A few days ago I wrote about another website stealing my blog content. I originally thought they just splogged me, but a quick look at my logs revealed they were hotlinking my images too.
Hotlinking is the art of using an image on one website while it is hosted on another. The website that posted the original image will be losing bandwidth when the image is displayed on the website that is using the image.
If you are using a host that has unlimited bandwidth, you probably don’t care about the bandwidth. The fact they stole your content is another issue. Either way you can protect your images from hotlinkers with a simple .htaccess file. If you have WordPress installed you already have a .htaccess file that controls your WordPress permalinks and file uploads.
My solution to the problem is to redirect the image to one I have stored on Flickr.com that simply asks, “Why are you stealing my stuff?”

Add this to your .htaccess file
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_REFERER} !^http://(.+\.)?mattdunlap\.org/ [NC]
RewriteCond %{HTTP_REFERER} !^http://(www.)?google.com(/)?.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://(www.)?facebook.com(/)?.*$ [NC]
RewriteCond %{HTTP_REFERER} !^$
#RewriteCond %{REQUEST_URI} !/images/stolen\.gif [NC]
RewriteRule .*\.(jpg|gif|bmp|png)$ http://farm2.static.flickr.com/1058/4730308927_e8f05fc681.jpg [L]
Make sure to include all the websites that might display your images. When I first activated this, I wen to Google reader to check out my feed, and sure enough my blog feed in Google Reader all had this new image. It might be better to not us the exclusive clause in the script and only create conditions for websites that you know are blatantly stealing your images.
If you are going to redirect them to an image that you host on your server, make sure to include an exception for that image, line 7 above. If you don’t they will get a redirect loop
Another problem that was caused by this website stealing my feed is that now my popularity plugin and feedburner is tracking hits from this website. I’m thinking of solutions for this…
First I think I’m going to edit my feed file to make sure I have a link before the content that says This was originally posted on mattdunlap.org. With a link. I try to link all my posts together, but I noticed some of teh posts on the website that stole my content do not have backlinks to me.





Post a Comment