Forum Moderators: coopster

Message Too Old, No Replies

protecting images with php and .htaccess

         

macdar

4:32 am on Jan 29, 2005 (gmt 0)

10+ Year Member



Hi,
I've a quite big website with lots of pictures. I'd like to protect it from espiders, image grabbers etc..
I've found two pretty good ways to protect it, one using .htaccess and one using php.

Those 2 ways based on http_referer. My question is: what will happen if someone doesn't have it on in his/her browser? The sript is useless? Can somebody tell me how to turn the http_referer feature? How to do that?
Anybody has experience with those scripts?

thanks.

[edited by: jatar_k at 8:01 pm (utc) on Feb. 1, 2005]
[edit reason] removed urls [/edit]

mincklerstraat

10:38 am on Jan 29, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Yes, the page itself says:


When this occurs your visitor will either not view the image even when he is on your site (which means that your own page will have broken link images), or he may be able to view your images even when it is displayed on the copyright infringing thief's site.

Hopefully the percentage of people who encounter this is small, but you have to be aware that these situations do occur.

Remember, HTTP is a fairly simple protocol. What this script is basically saying in case 1:
if referrer isn't my site, block;
case 2:
if referrer isn't my site, or there's no referrer present, block;
You'll also have people getting no images if you set case 2 since some people actually set the referrer string to something weird.

Basically, yes, the script isn't going to be very helpful for people who have referrer turned off. But this is the standard way of preventing hotlinking, and I don't think there's really another, better way of doing it given the way HTTP protocol is put together.