View Full Version : problems with .htaccess and disabling hotlinking

08-03-2003, 06:12 PM
I've uploaded the image 'redir.jpg' to my webserver, and an .htaccess file containing the following lines:

RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://(www\.)?artisticphotoz.com/.*$ [NC]
RewriteRule \.(gif|jpg)$ http://artisticphotoz.com/redir.jpg [R,L]

It's my understanding that this is supposed to replace the hotlinked image with the image 'redir.jpg'. However, all it seems to do is not display the hotlinked image (IE broken image box).

Any ideas?

08-03-2003, 07:37 PM
Doing so is completely unreliable and you could end up making is so many people cannot even view the image. Referrer information is supplied by the web browser. Not all web browsers supply it, or supply it correctly, and some allow you to modify it.

I spent some time trying to make this same method work reliably and it just isn't going to happen.

It would have been nice if browsers had to follow a standard as far as supplying referrer information then this would work nicely.