PureNews

PureNews is an amazingly sleek and powerful news theme with unlimited color variations.

View full feature list Check out the live demo Buy this theme today

How to stop someone hotlinking your images

Posted by on 6th Sep 2007 Design & Coding 20 comments

One week ago I wrote about how you can fight back against the scrapers, the content stealing scamming idiots who rip off posts from hard working bloggers. Since then, BloggingTips has unfortunately been scraped a few more times.

A blog about nothing, Elina from MyLlilAdventure and David from Pure Blogging were all kind enough to send me an email about two sites they found scraping me. Thanks guys, I really appreciate your support :)

The blogs which are scraping me are Blogging Orientated and Riza’s Site (dont worry, I’ve added the nofollow tag to these links!). Both sites are currently scraping every post which is published here. I have contacted Multiply about Riza’s site and I plan on faxing a letter to Google regarding Blogging Orienated. That site is using blogger so is covered by the Digital Millennium Copyright Act. It’s a bit of a pain that Google want you to fax a letter or send it by snail mail but at least they will do something about it.

htaccess code for preventing hotlinking

I had not got round to protecting my images from hotlinking sites until today but after seeing every one of my posts scraped by idiots I thought enough is enough, let’s have fun with these scumbags! There is only so much you can do when someone steals your content but stopping them hotlinking your images is something you do have control over.

I have used htaccess to protect hotlinking on several sites in the last few years however for those sites I stopped all sites from hotlinking. For Blogging Tips I only want to stop the domains I specifiy so I followed Surprise Highway’s excellent guide ‘How To Stop Hotlinking and Bandwidth Leeching‘ (I recommended this in my previous article too).

Here is the code I added to my htaccess file to stop them hotlinking images in the posts they are scraping.

RewriteEngine on

# Attempt to stop hot linking from these specific sites

RewriteCond %{HTTP_REFERER} ^(.+\.)?multiply.com/ [OR]
RewriteCond %{HTTP_REFERER} ^(.+\.)?blogspot.com/
RewriteCond %{REQUEST_URI} !/images/hotlinker.gif
RewriteRule .*\.(gif|jpg|png|avi)$ http://www.bloggingtips.com/images/hotlinker.gif

As you can see from the above code, I have blocked Blogger (Blogspot) and Multilply bloggers from hotlinking images here. I could have blocked all sites but for now I’m happy to just block the domains of scrapers I find. However, the above code didn’t work 100%, I checked BloggingTips on a newsreader and quickly noticed that the hotlinking image was being displayed there which is obviously not what I want.

I went back to Google and started searching for some htaccess tutorials. Thankfully I soon came across this article which said that you had to add the line below so that everyone else will still be able to link to the images.

RewriteCond %{HTTP_REFERER} !^$

The code I added to my htaccess file now looks like this :

RewriteEngine on

# Attempt to stop hot linking from these specific sites
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} ^(.+\.)?multiply.com/ [OR]
RewriteCond %{HTTP_REFERER} ^(.+\.)?blogspot.com/
RewriteCond %{REQUEST_URI} !/images/hotlinker.gif
RewriteRule .*\.(gif|jpg|png|avi)$ http://www.bloggingtips.com/images/hotlinker.gif

Now that we have got the correct code, we can now design an image which will be displayed in the scrapers blogs.

The image

The image I designed to show on the images in my posts was this :

Hotlinker image

Of course you could be more specific, you could write ‘This site is scraping content from my site’ or something like that. It’s really up to you.

Seeing it in action

Let’s see it in action!

* I’ve used my RSS post which I wrote 3 days ago and used the Blogging Orienated scraping site for this illustration.

Content Stealing blog before I edit my htaccess file
Before htaccess change

Content Stealing blog with my superhero hotlinking image displayed
My first hotlinking image

Increase the size of your hotlinking image

It’s worth noting that the image you specify to be displayed on sites which hotlink your image will be displayed in full ie. it doesn’t matter if your hotlinking image is 200 pixels in width or 300, the full image will be displayed. There is one limitation to this though.

Have a look at the screenprint below :

Increasing the size of your hotlinking image900 pixels in width and 460 pixels in height. It’s perhaps not too clear at first glance what has happened in the above screenprint but if you look closely you will see that the hotlinking image has been cut off. The reason for this is simple, the hotlinking image was too large for the content area.

Two things to note about this :

  • The image does not get cut off vertically ie. you could make your hotlinking image 3000 pixels in height if you wanted.
  • The hotlinking image did not expand to 900 pixels on this blog because the blog theme was coded correctly in CSS. Quite a lot of blog themes have problems with images which are too large therefore on another blog the image may have expanded to 900 pixels (ie. they would have expanded over the set content area)

If someone is stealing your content on a regular basis I suggest you get in the habit of placing images in your posts (smilies will do!). Then all you need to do is design a 5000 by 5000 pixel hotlinking image. See how long the scrapers will rip your site off if you do that!!!

Seriously, by making your hotlinking image large in height you are not only telling the scrapers website visitors that the content is stolen, you are also making it very difficult for anyone to read your article on their site.

Summary

Having your blog posts ripped off is frustrating, very frustrating. However, if you get in the habit of placing images in your posts and update your htaccess file to stop hotlinkers you will be able to annoy the scrapers and discourage them from stealing your content.

As I mentioned at the start of this post, stopping other people from hotlinking your images is something you do have control over so I encourage you all to bear this in mind if your content is being ripped off.

As always, if you have any questions regarding any of this, please let me know and I’ll do my best to help.

Good luck,
Kevin
:)

———————————————–

Articles referenced in this post :

Fighting back against the scrapers (My post about blog scraping last week)
Digital Millennium Copyright Act – Blogger – A google information page telling you how you can report scrapers who are using the Blogger platform.
How To Stop Hotlinking and Bandwidth Leeching – The first htaccess hotlinking tutorial I referenced.
Smarter Image Hotlinking Prevention – The second htaccess hotlinking tutorial I referenced which showed us how to limit our hotlinking image to the domains we want.

Kevin Muldoon is a webmaster and blogger who lives in Central Scotland. His current project is WordPress Mods; a blog which focuses on WordPress Themes, Plugins, Tutorials, News and Modifications and useful resources such as 101 Places To Find Images For Your Blog Posts.

20 comments - Leave a reply
  • Posted by A Blog about Nothing on 6th Sep 2007

    Nice. That dog crap looks really… gross? And it links to auction ads. Are you trying to tell us something about them as well? :shock:

  • Posted by RSS Newsniche on 6th Sep 2007

    I recently added a copyright notice to the end of each post in my RSS feed. I will be trying the image replacement technique soon.

  • Posted by Wallace on 6th Sep 2007

    my site had been down several times,

    here is mine,

    it will block all other domains,

    RewriteEngine on

    RewriteCond %{HTTP_REFERER} !^$

    RewriteCond %{HTTP_REFERER} !^http://(www.)?yourdomain.com(/)?.*$ [NC]

    RewriteRule .(jpe?g|gif|bmp|png)$ nohotlink.jpg [L,NC]

  • Posted by Laarni on 7th Sep 2007

    *PUKES* hehehe.

    Thanks for sharing. :)

  • Posted by Kevin on 7th Sep 2007

    A Blog about Nothing – AuctionAds. It isn't linked to auctionads, I wouldnt link to a site unless I was referencing it. Not sure how you think I did :)

  • Posted by Kevin on 7th Sep 2007

    update – I removed the dogcrap hotlinking image I had used as an example – it was starting to make me feel sick!!!

    :)

  • Posted by Kevin on 7th Sep 2007

    A Blog about Nothing – Just checked the site that is scraping BloggingTips, that site is adding auctionads links to all affiliate links. You must have got mixed up and thought I did that.

  • Posted by A Blog about Nothing on 7th Sep 2007

    Oh ok that makes more sense. I was wondering how you planned to sell someone on auction ads linked via a pile of dog crap. Lol

  • Posted by Online Community Bui on 7th Sep 2007

    It never occurred to me to use this as a tactic against scrapers and splogs.

    What a great idea!

    - Martin Reed

  • Posted by My Lil Venture on 7th Sep 2007

    Great tip Kevin. Hope it puts those idiots off from content stealing from your site :twisted:

  • Posted by sikanrong on 8th Sep 2007

    I don't know if it occurred to you, but if you serve up an image in place of the image you're denying, they still get your bandwith. (Durrr… PWWWWND!)

  • Posted by samulli on 9th Sep 2007

    Thanks a lot for this article! I don't even remember through which link I came here (I have about 15 different websites open at the moment), but I implemented this tactic right away in my own blog.

    Although I have to say, instead of blocking certain domains, I was rather more interested in protecting only certain of my folders against all external linking. I didn't want to block all of my image folders, because I use some of my images on my own mySpace profile, for instance.

    Having no idea about this htaccess stuff I was afraid I might scramble my whole page or something, but luckily it worked fine on the first try. :wink:

    Thanks again for the idea!

    Sandra

  • Posted by Kevin on 9th Sep 2007

    Wallace – Forgot to reply to your comment before, yeah that code will stop all domains. Thanks :)

    sikanrong – thats very true however this tactic is used to discourage people from stealing your imagea and your content. As you say, your bandwidth is still being used. However, you can make the hotlinking image very low on quality and filesize so that your bandwidth is reduced.

    samulli – Glad you got it working, It's a very useful tactic in my opinion, particularly if people are stealing you content.

    If anyone is having problems with this please let me know :)

    Kevin

  • Posted by Rose Sylvia on 8th Oct 2007

    :?: What do think about stumblers using the StumbleUpon PhotoBlog It! tool to help their reviews of your blog stand out and send you more traffic? Hotlinking is an interesting paradox: while it does use bandwidth it also brings in traffic.

    I suspect that even additional bandwidth would cost less than advertising so it can be an economical way to grow blog readership and potentially blog income.

  • Posted by aryadewangga on 18th Oct 2007

    Dear: Mr Kevin and all blogging tips lovers.

    First at all I have to apologize for scrap and copy writing from blogging tips contents including images and videos. As for your information, I'm newbie/new blogger without knowing what I'll do with blogging. Whatever I really love found blogging tips.com and give me inspiration how to start publishing on blog. But you know, English was not my first language ( My English is not so good), so at the time till know I just simply copy paste to my blog. One again I'm so sorry, really really sorry for my big mistake one.

    Sincerely yours,

    Aryadewangga

  • Posted by Sparky on 7th Apr 2008

    So has anyone figured out how to prevent people from hotlinking images on a Blogger/Blogspot blog?

    I am constantly posting blog items with images, only to find my blog item posted somewhere else, along with the images.

    I have not found any way to do this in Blogspot, unless I am missing something.