PDA

View Full Version : A good Hotlink Blocker


kingping
08-28-2000, 02:51 AM
I know this question has been asked 100's of times in the past but now I need to know what to put into my .htaccess file to prevent hotlinking.. i know you need to put in the ip# and domain name.. if someone could paste it below I would be thankful

jojo
08-28-2000, 03:06 AM
ErrorDocument 404 http://www.yoursite.com

RewriteEngine on
RewriteOptions inherit
RewriteCond %{HTTP_REFERER} !^http://w*\.*mydomain.com
RewriteRule .*[Jj][Pp][Gg]$|.*[Gg][Ii][Ff]$ http://www.some-nasty-place.com/


this should do it

kingping
08-28-2000, 03:13 AM
Don't you have to include the ip# because couldn't they hotlink the ip# instead of the domain?

shane
08-28-2000, 06:49 AM
yep, you can add new lines
eg
RewriteCond %{HTTP_REFERER} !^http://www.yoursite.com.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://yoursite.com.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://123.245.789.676.*$ [NC]

xApster
08-28-2000, 09:28 AM
Would this go in your root dir or in the dir you want to protect?

jojo
08-28-2000, 09:47 AM
put it in your root