PDA

View Full Version : Protecting Forum Images from Hot linking


UKBusinessLive
01-18-2009, 11:35 PM
Hi All

Is there a way to protect forum images to prevent people copying them elsewhere via hotlinking?? Just noticed a few of on my forum have been linked this way, adds to my bandwidth too :mad:

Watermarking is an idea but that won't stop people 100%, and we all know that the "no right click hack can be bypassed".

Would be nice to come up with an idea that would benefit Forum Owners, and prevent their images from being hotlinked like this. I know people will always copy images and pictures, But Hotlinking can use up a lot of your bandwidth.

For other sites, however, it's a much bigger problem. If a 100K JPEG is hotlinked on a site that gets, say, 1,000 hits a day, that?s 100MB of data transferred from your site without a single person actually visiting your site. If you have only a few gigabytes of transfer available per month ? or worse, pay money per gigabyte ? this can add up. And if someone were to leech an entire gallery from your site ? :eek:

I wonder what do artwork and graphic forums do to prevent this??

In my case, i have deleted the two images :(

KevinL
01-19-2009, 01:16 AM
If you have cpanel you can do it from there.

gct13
01-19-2009, 01:34 AM
If you can use .htaccess files this page may be a help to you:

http://www.htaccesstools.com/hotlink-protection/

UKBusinessLive
01-19-2009, 04:58 AM
Wow, Thanks guys i'm going to give the .htaccess a bash later, and perhaps do it so it replaces the picture with another one ;), That way i can get some free advertising for my forum :D

Couldn't wait :)

This is what i added to my .htaccess file right at the bottom

RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://www.ukbusinesslive.co.uk/forum/.*$ [NC]
RewriteRule .(gif|jpg)$ http://www.ukbusinesslive.co.uk/forum/images/misc/hotlink.jpg [R,L]

so when someone hotlinks to an image on my site the image will get replaced by this one

https://vborg.vbsupport.ru/external/2009/01/53.jpg

so this is what you need to do...

Open up your notepad or another text editor, and copy the code above to it. Name this file .htaccess and make sure it doesn't have an extension on the end, like .txt. If it is named .htaccess.txt, rename it .htaccess. Save it and upload it to your main directory on youir server. Or, you can upload it as .htaccess.txt, and rename it when it's on your server. If you already have a .htaccess file in your directory, because you have an IP block or something, just put the code beneath whatever you already have.

Replace mysite with the url of your site. Replace the hotlink.jpg with the url of the image you want to show up instead of your own when people hotlink to it.

Now i'm look forward to some free advertising ;)

Vaupell
01-19-2009, 01:39 PM
now this is pretty sweet. ;) haha

UKBusinessLive
01-19-2009, 05:16 PM
now this is pretty sweet. ;) haha

The more i think of it the more i love it :cool:

I thought about doing it from cpanel, but no, I think we need to do a little deterant and a spot of Free advertising. I can just imagine the look on their faces when they see the replacement pic :D:D

I'll write this up as an article, so everyone can learn how its done, and its handy to refer back to :up:

Dismounted
01-20-2009, 05:16 AM
Nice big image, I like! :)

JesterP
07-14-2009, 10:38 PM
Looking for similar help, I used the examples given here and am unable to prevent hotlinking to albums on my site. The url contains picture.php, not jpg|gif|png.

http://www.myforum.com/forums/picture.php?albumid=88&pictureid=9526

# stop hotlinking and serve alternate content
RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?myforum.com [NC]
RewriteRule .(jpg|jpeg|png|gif)$ http://www.myforum.com/images/hotlink.jpe [R,NC]

That code works, but need to include picture.php in there and I cannot seem to get it to work.

Thank you

BarelyHangingOn
08-06-2009, 12:19 AM
I can't get it to work either it appears that all photo albums can be hotlinked. If anybody has a clue it would be nice.

BTW adding php to last line does not work either.