PDA

View Full Version : .htaccess hotlinking blocking question


smack
10-23-2006, 02:40 AM
Hello all,

I know how to block refering web address and ip's to my site through .htaccess, but I haven't found a way to do it when the refer is using a refering blocking site like the one found at www.anonym.to. Can anyone help?

_Aerospace_Eng_
10-23-2006, 04:23 AM
I use this on my site and it works fine.
RewriteEngine on
RewriteCond %{HTTP_REFERER} !^http://yoursite.com/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://yoursite.com$ [NC]
RewriteCond %{HTTP_REFERER} !^http://www.yoursite.com/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://www.yoursite.com$ [NC]
RewriteRule .*\.(jpg|jpeg|gif|png|bmp)$ - [F,NC]
Make sure you change all instances of yoursite.com to your actually site a address.

smack
10-23-2006, 05:30 AM
Thanks AE...your rewrite's work better than the ones I was using...cheers :)

smack
10-24-2006, 03:26 AM
strange...when I used your rewrites, it affected the link from my site to the page that I was trying to block refers from, so I'm back to square one with the refer blocking site. :(

_Aerospace_Eng_
10-24-2006, 06:53 AM
Did you actually change yoursite.com to reflect your own url or did you just leave it that way?

smack
10-25-2006, 02:30 AM
Did you actually change yoursite.com to reflect your own url or did you just leave it that way?
hehe, yep, I changed it