Archive for ‘Miscellaneous’ Category
Miscellaneous »

Micro-entry: Stop hotlinking

datePosted 1:34 PM, October 28th, 2010 by MarkleB

Going through my site’s stats the other day, I discovered that somebody had been hotlinking some of my images. I wouldn’t have minded all that much (I have unlimited bandwidth), except it was a picture of my son, and that was just creepy.

I’ve disabled their ability to do this by adding the following lines to the .htaccess file on my server:

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTP_REFERER} !^http://(.+\.)? [NC]
RewriteCond %{HTTP_REFERER} !^$
RewriteRule .*\.(jpe?g|gif|bmp|png)$ [NC,R,L]

This now displays the following graphic:

For some reason, this makes me very happy.