View Full Version : How do you prevent hotlinking?
djkjpro
11-16-2001, 07:14 AM
Can someone pls. tell me what to put in .htaccess to prevent hotlinking ? I noticed that other servers are pulling images from me like crazy!! it's killing my bandwidth.. :(
I don't wanna block the whole site from being hotlinked though, I wanna still leave a directory to be allowed.. can someone pls. help me out.
Thanks.
Paparazzi
11-16-2001, 07:26 AM
use this:
AuthUserFile /dev/null
AuthGroupFile /dev/null
RewriteEngine On
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://www.yoursite.com/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://yoursite.com/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://www.yoursite.com:80/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://yoursite.com:80/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://209.10.247.162/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://209.10.247.162:80/.*$ [NC]
RewriteRule .*\.jpg$ http://yoursite.com/ [R,L]
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://www.yoursite.com/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://yoursite.com/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://www.yoursite.com:80/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://yoursite.com:80/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://209.10.247.162/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://209.10.247.162:80/.*$ [NC]
RewriteRule .*\.gif$ http://www.yoursite.com/ [R,L]
just replace the ip and url with your own
djkjpro
11-16-2001, 07:54 AM
Thankx,
where it says:
RewriteRule .*\.jpg$
what's that?
jimmyf
11-16-2001, 09:21 AM
Originally posted by djkjpro:
<STRONG>Thankx,
where it says:
RewriteRule .*\.jpg$
what's that?</STRONG>
I believe that's were you send them if they
hotlink a .jpg
Jim
vBulletin® v3.7.3, Copyright ©2000-2012, Jelsoft Enterprises Ltd.