PDA

View Full Version : How to stop someone hot linking my graphic



funbiz
09-18-2007, 08:46 PM
This might not be the right place.

I am sure this been ask before,
how to stop someone hot linking my graphics?

Thanks for any help.

getmea
09-18-2007, 11:27 PM
Your web host should have a setting to prevent this activity. My web host's vDeck system has an option under Settings to disable HotLinking.

Getmea

linkstraffic
09-19-2007, 11:12 AM
you can require the image loading from your pages only using the htaccess file.
I don't remember the line but you can check the documentation of htaccess from Apache

hostBrain
09-19-2007, 03:44 PM
Here ya go, put this in htaccess

RewriteEngine On
RewriteCond %{HTTP_REFERER} !^http://(.+\.)?domain\.com/ [NC]
RewriteCond %{HTTP_REFERER} !^$
RewriteRule .*\.(jpe?g|gif|bmp|png)$ /images/nohotlink.jpg [L]
create a very small file called nohotlink.jpg, which will replace the pic they are hotlinking to.
In the image, you could say "Stolen from www.yourdomain.com"

Portucuenta
03-20-2008, 06:54 PM
Is there a way to only disallow images from a folder for being hotlinked??

Thanks in advance

wige
03-21-2008, 09:14 AM
Yes. Simply create a new .htaccess file in the folder you want to protect, with the above suggested directives. That will only cause that specific folder and it's subfolders to be blocked.

obietemp
06-14-2008, 06:45 PM
This happened to me once and I changed the picture they were using to my business logo, keeping the name the same. Then my logo picture was on their site.

Of course I then I changed the name to the picture they had been using and relinked to my page.

Thought it would be funny and I got a kick out of it.

Jean-Luc
06-15-2008, 10:59 AM
hostBrain' solution is fine, but you might want to add other authorized referrers, like the pages in Google cache.

Jean-Luc

LLFitness_Derek
06-20-2008, 04:14 PM
IMO image control is best done through calling a script for the image and not linking directly to the image.

Normal image (no scripts):

<img src='image.jpg'>

New image (scripts):

<img src='myimagescript.php?image=image.jpg'>

On your new scripting page myimagescript.php you can write all the validation code you desire before displaying the images. You can check a users is log-in status, check the referral url, etc...

cw1865
06-23-2008, 11:02 PM
This happened to me once and I changed the picture they were using to my business logo, keeping the name the same. Then my logo picture was on their site.

Of course I then I changed the name to the picture they had been using and relinked to my page.

Thought it would be funny and I got a kick out of it.

Thought it would be funny...it is funny. That'll teach 'em!