Thread: Major Hotlinker
View Single Post
Old 2004-07-26, 08:09 PM   #10
chilihost
Look at 'em. Watchin' my TV. Sittin on my couch. You better not be in my ass groove!
 
chilihost's Avatar
 
Join Date: Aug 2003
Posts: 465
To stop all hotlinkers use this code in your htaccess file (stored on your root directory):

Quote:
RewriteEngine on

RewriteCond %{HTTP_REFERER} !^http://yourdomain.com.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://www.yourdomain.com.*$ [NC]

RewriteRule .*\.(gif|GIF|jpg|JPG|mpg|MPG|Mpeg|mpeg|MPEG|rm|RM)$ http://www.yoursponsor.com [R,L]

To allow certain domains to hotlink, just copy the two RewriteCond lines and add in the domains you want to hotlink.

Oh, one other quick point, htaccess is a bit fussy depending on your server's apache setup and mod rewrite options, so its always best to consult with your hosting company if you have issues getting it working.


cheers,
Luke
__________________
HunkMoney+BritishBucks+LatinoBucks=50+ gay sites!
chilihost is offline   Reply With Quote