PDA

View Full Version : htaccess hotlink question


Fonz
2005-01-13, 05:21 AM
I have this htaccess code that should keep my images from getting hotlinked. The problem is that it works if the url doesn't have "www" in it but when the url does have www in it the picture shows normal.

This is the code.

--------------------------

RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://(www\.)?extremelyhotbabes.com(/)?.*$ [NC]
RewriteRule .*\.(gif|jpg|jpeg|bmp)$ http://www.ars4real.com/re.php?s=BTMM&a=1016261&p=p&b=hotlink&cen=&c= [R,NC]

---------------------------

So when I link to this url: http://extremelyhotbabes.com/free/boobs/darlenesjuicyjuggs/pics/2.jpg
I get redirected.
But when I link to this url I still get the picture: http://www.extremelyhotbabes.com/free/boobs/darlenesjuicyjuggs/pics/2.jpg

Anyone?

EDIT: Strange, seems to work now... must have been a cache thing...

kaktusan
2005-01-13, 06:17 AM
I am using a similar script, and it must work either ways with www and without. You sure it is not working?

Useless
2005-01-13, 10:32 AM
Originally posted by Fonz

EDIT: Strange, seems to work now... must have been a cache thing...
I would have said alcohol consumption, but it could be your cache too.:D

Cleo
2005-01-13, 10:36 AM
If you use wildcards in your htaccess then all someone has to do to hotlink you is put the images in a folder named after your domain.

See my notes page for how to do it without wildcards.
www.cleoslinks.com/adult-links/webmaster-help.php

Fonz
2005-01-13, 12:00 PM
Thanx for the link Cleo :)

UW, since I was sick yesterday I didn't drink on a wednesday for the first time in 7 years or so :D

... I had this hungarian site hotlinking one of my freesite's pictures. I'm sending their hits to a sponsor now, already 23k hits in 7 hours.