Hotlinked no more

user-pic
Vote 0 Votes

Dashboard icon
Someone had recently hotlinked to an image I'd posted here which was using a decent amount of bandwidth. Having never run into this before, I decided to nip it with the following .htaccess file (which resides in the root of my web directory):

RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://([-a-z0-9]+\.)?(348north|bloglines|google)\.com [NC]
RewriteRule \.(gif|jpe?g|png)$ - [F,NC,L]

This is a small variation on the code described in this tutorial. What it says is to allow requests on gif, jpeg, jpg, and png files from the 348north, google, and bloglines domains.

About this Entry

This page contains a single entry by Kevin published on August 18, 2005 5:17 PM.

Apple volumes on NetBSD was the previous entry in this blog.

Adium settings for Google Talk is the next entry in this blog.

Find recent content on the main index or look in the archives to find all content.