Thread: Anti Hotlinking
View Single Post
Old 2008-11-14, 02:36 PM   #7
cd34
a.k.a. Sparky
 
cd34's Avatar
 
Join Date: Sep 2004
Location: West Palm Beach, FL, USA
Posts: 2,396
That rule is only allowing fotopiccanti.it to link your images, so, its the reverse of what you want.

There are two ways to do it.

1) block all hotlinking allowing your domain

Code:
RewriteEngine On
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://(www\.)?yourdomain.com/.*$ [NC]
RewriteRule \.(jpe?g|gif|bmp|png)$ - [F]
2) deny specific sites from hotlinking

Code:
RewriteEngine on
RewriteCond %{HTTP_REFERER} fotopiccanti.it [NC]
RewriteRule .* - [F]
A better rule that is likely to catch a few potential ways that they can potentially work around your rules is:

Code:
RewriteEngine on
# leave this line in allow empty referrers, remove to disallow empty referrers
RewriteCond %{HTTP_REFERER} !^$ [NC]
RewriteCond %{HTTP_REFERER} !^http://(.*@)?([a-z0-9-]+\.)*yourdomain\.com(:[0-9]+)?(/.*)?$ [NC]
RewriteRule .*\.(asf|mpg|mpeg|wmv|avi|rm|gif|jpe?g|png|zip)$ - [NC,F,L]
__________________
SnapReplay.com a different way to share photos - iPhone & Android
cd34 is offline   Reply With Quote