Hotlink Block

Posted by Nessa | Posted in | Posted on January 14, 2007

0

So I finally figured out what caused the huge bandwidth spike on my site last month.  Seems some idiot was hotlinking my MP3s and old images from the Jukebox and gallery on my previous site…I guess he’s out of luck now that they’re gone.  Anywho, for those who don’t have the luxury of cPanel, here’s a simple Apache rewrite to keep people from jacking your images and stuff:

 

RewriteEngine on
RewriteCond %{HTTP_REFERER} .
RewriteCond %{HTTP_REFERER} !^http://(www\.)?site\.com [NC]
RewriteRule \.(jpe?g|gif|png|bmp|mp3)$ – [NC,F]
 

Share and Enjoy:
  • Digg
  • DZone
  • del.icio.us
  • Technorati
  • Facebook
  • Google Bookmarks
  • StumbleUpon
  • Twitter
  • Sphinn
  • Mixx
  • blogmarks
  • Furl
  • Reddit
  • Slashdot
  • RSS

No related posts.

Post a comment