This is the web log of Tim Bennett, web designer. He also runs Texelate, offering the best web design Leeds, Yorkshire has to offer

Prevent Hotlinking Via Image Display

Saturday, July 1st, 2006 at 8:45 am

Display an image when people try to steal your bandwidth.

RewriteEngine on

RewriteCond %{HTTP_REFERER} !^http://(www\.)?yourdomain1.com(/)?.*$     [NC]

RewriteCond %{HTTP_REFERER} !^http://(www\.)?yourdomain2.com(/)?.*$     [NC]

# keep adding domains as you like

RewriteRule .*\.(gif|jpg|jpeg|bmp)$ http://www.yourdomain.com/img/stopstealing.jpe [R,NC]

# not the above image has .jpe extension not .jpg

# this prevent recursion

Leave a Reply

You must be logged in to post a comment. If you don't have an account register one now.

Do you need a website or web-related service?
I run an award-winning web design studio.