Thief! Stop hot-linking my image!

by Michael Aulia on 13 March, 2008 in Blogging

Have you ever caught someone hot-linking an image on your site? If you don’t know what hot-linking is: (from Wiki)

Hot-linking is when someone uses a link to an image that is saved on another website instead of saving a copy of the image on the website that the picture will be shown on.

Why hot-linking is bad? Because when someone is hot-linking your image, he/she is using your server’s bandwith to serve the image to their readers. So let’s say you took a picture in Paris on a holiday and you put it up on your blog (let’s say the file size is around 1 Mb). I saw the photo on your blog and then hot-link it on my own blog. That means when my readers view the photo, they actually use your server’s bandwith instead of mine to display the picture. If I have 1000 readers daily looking at the picture, that means I’ve stolen 1000 * 1 Mb of bandwith from you and you are not even aware of it.

Today I found a site that is hot-linking to an image on my post about SMSDiscount. I’m gonna tell you a good way on how to stop people from ever hot-linking to your images.

No, it’s not email-ing them and asking them to stop. You can. That would be nice. However, do you have the time once your site has grown? Or do you even bother to check your server stats, etc to find out whether any of your images are being hot-linked?

What you need to do, is to create an htaccess file and put it on the folder where you store your images. Inside this file will be a set of rules to tell your server, that none of the files inside can be accessed/loaded if they are not requested by a page on your own site. So for example, “If a website outside of www.cravingtech.com wants to load an image from my server, rejects it”. You can also be creative and redirect all images to an image of your choice, for a revenge, if you are into that kind of thing ^^

Instructions
Download the htaccess file from here, open it with your text editor and replace YOUR_DOMAIN with your domain name. On the last line, replace it with the path to the image that you want to display when someone is hot-linking your images. Or if you prefer to just block it, simply change the last line to

RewriteRule \.(gif|jpg)$ – [G]

Then, upload the file to the folder that contains your images & their respective subfolders. Rename the file to [dot]htaccess (replace “[dot]” with .)

Revenge is sweet

For example, here is a screenshot of the site that is currently hot-linking to my image:

SMSDiscount

After I applied the htaccess with image forwarding, the site now looks like:

Prevent Image Hotlinking

That should teach em’ a lesson! :D

My question is: I feel bad about the site’s author, though. Should I notify the owner? He/She probably doesn’t know that hot-linking is bad. I mean, I’ve done them before, I’m not a hypocrite. What do you think?



     

Don't miss out winning these great giveaways currently running at Craving Tech:

Handy Backup Giveaway

           

{ 56 comments… read them below or add one }

brady March 14, 2008 at 12:04 pm

Haha, I think you went easy on them. You could have had text on the image that said a lot worse. Actually, I’m sure people would still click on that link just because the image is funny.

Just my thoughts, haha!

brady’s last blog post..Coffeeshop Confessional

Reply to this comment thread

James R September 18, 2010 at 2:30 am

Or you can force the blog admin to pull it by redirecting the image request to something gross or pornographic (like goatse – google it if you are not familiar). :D

I actually had to do this in ONE case and then the miscreant had the nerve to leave me an email because I wouldn’t allow him to hotlink from my web pages.

Michael Aulia September 19, 2010 at 7:29 pm

But what if a poor innocent kid looking at those gross/pornographic images because of you? :(

That kind of revenge sounds good but you don’t want to be responsible for other people’s lives because of this :)

James R September 20, 2010 at 2:47 am

Michael, I am NOT responsible for other people that steal my bandwidth, especially when other efforts to stop it have failed. I had one that used one of my images on a facebook site of a musician. My image was logging thousands of hits a day (from my apache server log – I do own and run my own server!). I had contacted the musician to try to get it removed and was blown off. Changing to a mild wimpy “Stolen-From” image had NO EFFECT whatsoever. So I called out the heavt artillery and the hot link was removed in a day! You dont like how I did it! FINE by me! You are not paying my bills either.

Michael Aulia September 20, 2010 at 9:14 am

Hey..take it easy buddy :) I wasn’t mad or rude at you. We all have our way to do things and our principals. I don’t want to put porn pictures because I don’t know who are going to look at them at the other end. Do what you have to do.

The best way is probably to block the image so it will not steal any of your bandwidth at all

vance March 14, 2008 at 12:12 pm

Oh man… I’ve done this too many times… I always use someone’ image and post it to my blog directly from their site. Well, I guess I have to stop doing that…

vance’s last blog post..Hulu, Officially Launched!

Reply to this comment thread

Curt March 14, 2008 at 12:30 pm

I love it! Great idea. I’m going to add that to my htaccess file as soon as I get the time. (Better make myself a note).

I would definitely go for the revenge. It serves them right. I seriously doubt that anyone who knows how to hot-link, is unaware of the fact that it’s wrong.

Curt’s last blog post..WordPad Ever Try It?

Reply to this comment thread

Michael Aulia March 14, 2008 at 12:42 pm

Thanks for dropping in, guys

Well for example, vance here doesn’t know that hot-linking is considered stealing..
We’ve done it often because it’s so easy to link an image straight with the URL (rather than downloading it first, crop it, upload it, and link it to our post)

Reply to this comment thread

Deimos Tel`Arin March 14, 2008 at 2:59 pm

LOL @ Michael Aulia!

Nice screenie you showed em. ;)

Well, for myself, I make it a point to plaster my site’s URL onto any of my images so in the event that the images hosted on my site are to be hot linked, at least my URL is shown in the image itself.

As for hot linking directly to the files as downloads, perhaps I might need to use this .hta method that you spoke of. Plus, I need to edit one of my posts, as I am guilty of hot linking some files for download directly off another site.

Deimos Tel`Arin’s last blog post..Brand New Nokia N81 8GB For Sale – Collect at Shop in Kuala Lumpur, Wilayah Persekutuan, Malaysia

Reply to this comment thread

Crystal March 14, 2008 at 4:32 pm

I`ve seen this method used everywhere and it is very, very effective. Sometimes it`s just not possible to drill into people`s heads that hotlinking. is. bad! The screenshots are hilarious, maybe you should leave a comment giving the poor web owner a hint before he/she freaks out?

Looking forward to new and exciting posts as I embark on the 7 Day Combo!

Crystal’s last blog post..12 Awesome Blog Category Ideas And Others

Reply to this comment thread

TripTheLady March 15, 2008 at 10:48 am

Great article! When I first started surfing many, many years ago I had no idea I was actually stealing from others by hot-linking. I learned the hard way when a pic was changed to something really nasty ;) You were nice!

TripTheLady’s last blog post..LMAO!

Reply to this comment thread

Shanker Bakshi March 15, 2008 at 9:09 pm

Great Post Michael.

Shanker Bakshi’s last blog post..5 ways to stay happy in grim situations

Reply to this comment thread

Michael Aulia March 15, 2008 at 10:37 pm
vance March 15, 2008 at 11:57 pm

Well, I always thought it was the other way around. I was afraid that the site owners will e-mail if I download their images then repost it on my blog so I just hotlink it. Well, thanks for the info Michael..

vance’s last blog post..Hulu, Officially Launched!

Reply to this comment thread

Will March 16, 2008 at 8:45 am

That Digg image is too funny. I wonder if blocking rather than substituting can cause problems with Digg, Google, etc. You know, sites that link your image, but for valid reasons?

Will’s last blog post..Review: Live in the Balance by Linda Prout, M.S.

Reply to this comment thread

Lloyd Lopez March 16, 2008 at 9:36 am

LOL! Nice trick. I’m using cPanel’s hotlink protection to avoid this problem.

Lloyd Lopez’s last blog post..Pacquiao – Marquez II Match Live

Reply to this comment thread

Manda March 17, 2008 at 12:33 am

I hate when that happens! I Had to close my last blog because of the theives getting into my stuff and using my bandwidth. Err. Best of luck, and people- seriously, quit stealing!

Manda’s last blog post..The Ghosts In My Life

Reply to this comment thread

Anita March 17, 2008 at 10:52 pm

I’m with Vance on this. I thought if I don’t put the original website address the owner will be offended because I use it without permit and without giving credits. By hotlinking the images, readers on my blog can go directly to the owner’s site. I don’t know that it actually can be a burden. Maybe next time I just list down where I borrow the image then….

Anita’s last blog post..When Indonesian Goes Shopping

Reply to this comment thread

7leads March 18, 2008 at 3:29 am

I am totally with you on this one. I think anyone with any sense would download the pic to their computer. We all know that is not the case. Thanks for the tip and I’ll check this out. Good post 1

Reply to this comment thread

Michael Aulia March 18, 2008 at 11:48 am

Well since you are grabbing the image from another blog, you’re stealing their bandwith.

Unless if you mention about the site where you get the image from or link back the image to the site, then it will be total loss to the image owner.

Most of us link to the image to display on our page, but the image itself is unclickable, so no credits at all go to the original site.

Reply to this comment thread

Jenny March 18, 2008 at 6:27 pm

I have had my bandwidth stolen in this way and I couldn’t believe it. I just deleted the image.

So thanks for this information.

Jenny’s last blog post..Really useful plugins for word press

Reply to this comment thread

Franca Richard March 19, 2008 at 1:31 am

thats really bad experience, yes, use htaccess to defend urself. But, indeed, I don’t think u can prevent one really wanna hotlink ur pic, a simple php or asp code can definitely done the hotlink thing.

Reply to this comment thread

Donna March 22, 2008 at 9:22 am

Thank you so much for this info. My web server is threatening to shut down my site for the rest of the month because of exceeding my bandwidth. What? I don’t get that many visitors. I’m an artist/college student, working a day job as a secretary to pay the bills, and can’t afford to pay for more bandwidth, which is what I’ll have to do if I can’t put a stop to all this bandwidth theft. Now to do it… (keeping fingers crossed, because I’m not too good at this web stuff.)

When I checked the web stats on my server I saw the light. There was even a pagan witchcraft site using one of my original pastel drawings of a cat on it. Good grief! It’s Good Friday and my art is on a pagan web site! Not good.

Thanks so much for the Easter egg! :-) Happy Easter.

Reply to this comment thread

Michael Aulia March 24, 2008 at 10:51 pm

Wow Donna, it is bad indeed! It seems that the other site has lots of readers and therefore stealing your bandwith badly.

If you are having a small bandwith, I’d suggest to just block the image rather than replacing it with another image
So use the RewriteRule \.(gif|jpg)$ – [G] line (assuming the image is in .jpg or .gif)

Reply to this comment thread

James R September 18, 2010 at 2:42 am

All it takes is one post with a hotlink to a high traffic forum with lots of readers and your bandwidth allotment can drain FAST!

My apache access.log filled up like that before I figured out how to use .htaccess.

BTW people! HTACCESS only works on APACHE servers. If the server hosting your page is a Microsoft IIS server, then you will have to ask admin if they have another solution. Or move your page to an apache server.

Dallas Web Design March 27, 2008 at 2:23 pm

I love it. No you shouldn’t tell them. I replaced an image that was hotlinked to with an image of an obese man wearing a speedo. It was kept up for over a month.

Reply to this comment thread

Will March 28, 2008 at 2:32 pm

This thread about the theft of images is interesting. I just wish it was my only problem. I have had three posts scraped from my site in the past week. All from different scrapers. The last scraper has the full text of posts from many different blogs on his site. Talk about thievery! Take a look, actually I won’t post the link as I don’t want to give him any traffic.

And Michael – If you are reading this then yes, the new version fixed it!

-Will

Will’s last blog post..Earth Hour 2008

Reply to this comment thread

Michael Aulia March 28, 2008 at 3:08 pm

Hi Will, I wish there is a method to detect posts thievery! It’s okay if they link back to you, but if they really copy paste your posts for their own benefit, then they deserver a slap to the end of the universe!!

PS: Thanks for helping me testing the comments after upgrading my WP-SpamFree plug-in. All looks well!

Reply to this comment thread

Will March 28, 2008 at 3:34 pm

It is fairly easy to detect, but a lot of work to shut the site down. If they take your entire content, even with a link back to you at the end of the content, it is not fair use and is still plagiarism. The site I found today is a scraper pure and simple. There is nothing on their site but hundreds of full posts from other peoples blogs.

I think, (know) spammers and scrapers are despicable, and I usually try to ignore those types. But in this case because of the serious SEO penalty caused by having your content on more than one site, it can’t be ignored.

Will’s last blog post..Earth Hour 2008

Reply to this comment thread

Sparky April 8, 2008 at 10:17 am

Is there a way to prevent hotlinking on a blogspot blog? I have several people copying my blog items, which is ok, I just don’t want them to get the images. Hell, if I could prevent both that would be even better.

Reply to this comment thread

Alex April 22, 2008 at 9:31 pm
Michael Aulia April 22, 2008 at 10:12 pm

Sorry to get back this late…

@Will: That sucks..can you report it to Google? I don’t think they can do anything though..as there must be other sites like these..

@Sparky: Sorry I’m not sure about a blogspot blog.. since your contents are hosted on their server, not yours, you have very little control of it..

Reply to this comment thread

Deimos Tel`Arin April 29, 2008 at 1:14 pm
Michael Aulia April 29, 2008 at 1:20 pm

O_o that’s weird stuff..

I’ve checked by clicking on the link and it brought me to download.com (if you roll over your mouse, does it display the download.com url or this url?)

Reply to this comment thread

David June 3, 2008 at 10:21 am

You should instead use a screenshot of the Rick Roll video.

Reply to this comment thread

Michael Aulia June 3, 2008 at 9:46 pm

Hahah maybe I should :)

Reply to this comment thread

John June 4, 2008 at 2:06 am

If they host your image themselves is it breaking copyright?

John

Reply to this comment thread

Michael Aulia August 7, 2008 at 10:52 pm

As long as the images are free images, then they don’t. But if the image belongs to me (my own screenshot or design), then I believe they do

Reply to this comment thread

Feabionsu August 19, 2008 at 6:39 am

Oh, one of my friends is really suffering from hotlinking – I’m definitely emailing him the link to this blog post – and then you can get even more visitors to your blog! :D Thanks so much for explaining how to prevent this!

Feabionsus last blog post..Fantastic Contest Gives A Free Domain Name!

Reply to this comment thread

Michael Aulia August 20, 2008 at 12:08 am

Thanks, Feabionsu. Ask him to prepare a nice photo of him for the thieves (just like mine :D )

Just be careful to unblock accesses to certain sites like Digg, etc or you’ll see the stupid photo on unexpected places

Reply to this comment thread

Feabionsu September 22, 2008 at 7:44 am

Michael, the link doesn’t work anymore! I contacted that friend, and he said it didn’t work, so I checked, and he was right! Can you fix it, or at least post the link here please? :D Thankies!

Reply to this comment thread

Michael Aulia September 22, 2008 at 9:45 pm

Oops.. thanks for letting me know. I have fixed the download link. Please let your friend know!

Reply to this comment thread

Feabionsu September 23, 2008 at 9:29 am

Thankies! :D By the way, for the revenge image, you could put an advertisement/logo of your site! :D That way you can get something out of their stealing as well! xD

Feabionsus last blog post..Two free domain names? I’m sorry, I meant THREE!

Reply to this comment thread

chris November 16, 2008 at 11:47 am

Great tip. Another way to have fun with hotlinkers is to make an insanely wide image – like 2000+ pixels wide – and rename it to the file someone’s stealing, just keep the file size small. It will screw up the width of most websites making everything scroll to the right. And, if someone has linked to your image in a forum, it will piss everyone else off who reads the forum. Eventually, webmasters will wise up and remove the links or prevent external linking.

Distasteful images can also be fun to use, but that’s just me :)

Reply to this comment thread

James January 18, 2009 at 4:39 pm

You really are an old softy with your bandwidth.

I found a 1000×1000 pixel gif image that alternates black and white, and I edited it to say “no hotlinks” in red on the black screen and blue on the white screen… I have it set to alternate black/white at .1 seconds (that is 1/10 of a second) and have been told that it could almost bring on a seizure. It is most unpleasant to look at and could cause the hotlinker to be quite unwelcome on whatever forum or page he posts that to.

I have been forced to resort to redirecting to hard porn on an occasion when all else failed. The image was much worse than the goatse pic that has been around. If you really want to gross ‘em out look for an image of beastiality in some form.

I have gotten some nasty emails because I was considered to be a poor sport for refusing to allow images to be hotlinkled onto high traffic forums to which I was not a member.

…Or you can just set the [F] flag in the .htaccess file and then all attempts to hotlink get a 403 error.

I do have a question though: I have had images linked into emails such as Yahoo mail that has apparently been [cc: [email protected], etc.] forwarded to multiple recipients. Can .htaccess be used to block this?

Reply to this comment thread

Michael Aulia January 18, 2009 at 8:09 pm

Hm sorry, I don’t know the answer with hard images linked into emails. Although I remember that I took out hotlinking protection on this blog because my email subscribers are getting the blocked images on their emails :( So I guess the htaccess actually works for image hardlinking on emails.

cyana April 2, 2009 at 1:35 pm

Micheal,
Thanks a lot for those htaccess codes,
it is working fine, except that for some reason, they are not getting the image from my path !
but i have a question regarding my feedburner subscribers – are they gonna still received my newsletter properly ?

Because if they dont then, it is kind of annoying.. Maybe there is other solution to fight against hotlinks ?

cyana´s last blog post..Hotel Particulier : Le Charme Parisien

Reply to this comment thread

Michael Aulia April 3, 2009 at 10:00 pm

I remember that you need to add a code to make sure your RSS feed reader to see the image (or else they’ll see the blocked/porn image!!!). I remember having a problem to make it work for email subcribers though, so I took this code out :(

My hosting gives unlimited bandwidth anyway

JAB_au April 2, 2009 at 2:58 pm

Seriously goatse or tubgirl is enough to gross them out. It usually educates them well especially if they are hot-linking on a forum and they get banned.

JAB_au´s last blog post..Mozilla Firefox 3.0.8 Released

Reply to this comment thread

Babaji M P September 26, 2009 at 1:57 pm

Using a replacement image is working.

But … ,

The replacement images changes to the dimension of the copied image !

For eg.,

The original image is http://mysite.com/image.jpg of dimension 800×900
replacement image is http://hosted.com/image.jpg of dimension 200×300

Now, the problem here is the replacement image is stretched to 800×900,
making it hard to see the warning on the replacement image.

Any idea how to make the replacement image to show specific dimension via .htaccess ?

Thank You.
.-= Babaji M P´s last blog ..The Internet’s Most Hard Marketing Scheme =-.

Reply to this comment thread

Alison Moore Smith December 10, 2009 at 7:37 pm

A few years ago I was an eBay powerseller. One of my competitors — who didn’t have good images — decided to use mine and hotlinked to them from MULTIPLE auctions.

I switched the image on all my auctions and uploaded a file with the same name of the hotlinked file. It said something like, “This is a stolen image.”

He got all teed off because he could either (a) leave the images for the duration of the auctions or (b) prematurely end all the auctions and still pay the listing fees.

Really? How about get your own images?

Reply to this comment thread

Michael Aulia December 11, 2009 at 1:01 am

Heeh, you got that right! He deserved it. You should have left your link on the replacement image instead to steal his sellers to you ;)

Kendin Tasarla February 19, 2010 at 1:19 am

But why bother? DOn’t you like these hot linkers would use your images hosted in your site and post into theirs?

Reply to this comment thread

Michael Aulia February 19, 2010 at 9:14 am

Um if you read my post carefully, it states that they are stealing your bandwidth and also some resources from your server, which isn’t good.

Unless you put a watermark in your images (Which is what I do now), you won’t gain anything but lose a lot more by having someone steals your images

Sam September 17, 2010 at 1:53 pm

Michael, if the main problem was because they steal our bandwidth then how this image replacement tactic can solve that problem? because the image is coming from our website.

Reply to this comment thread

Michael Aulia September 17, 2010 at 9:04 pm

Well if you “steal” an image from a web and realize that it shows “rubbish” when you preview your page/post on your site/blog, then you’ll definitely take it out, right? :)

Leave a Comment

CommentLuv enabled.

  Subscribe to future comments on this post

{ 2 trackbacks }

Previous post:

Next post: