Forum Moderators: phranque
Thanks for any help.
--
Mike
Welcome to WebmasterWorld [webmasterworld.com]!
Use any one of the many examples [google.com] found here for anti-hotlinking .htaccess code, and modify it to specify the "allowed" referrer. You will also need to allow blank referrers, since many of your visitors will come from behind firewalls and proxy servers that block the referrer.
Jim
What I mean by that is, I don't want someone to put in [mydomain.com...] and be able to see the image.
This is what I have now...
RewriteEngine On
RewriteCond %{HTTP_REFERER}!^http://(www\.)?mydomain\.com [NC]
RewriteRule \.(gif¦jpg)$ - [NC,F]
Thanks,
Mike
AOL does this a lot. The Norton Internet Security package also blocks referrers, but I'm not sure if it does so by default, or if the user has to turn it on. However, I doubt you want to spend all day on the phone debugging these issues with your users and their ISPs, so the simple answer is to allow for blank referrers using "^$" as the regular expression for a blank referrer. This does indeed open a "hole" in your image protection, but that is offset by the sometimes-huge problems you can have if you block authorized users who do not provide a referrer -- We've got several old threads here from Webmasters who experienced that "Help desk" nightmare and needed help to fix their code.
Jim