Thwarting Image Linking

Thwarting Image Linking

A friend of mine has a problem with his images getting linked by bulletin board groupies looking for cool avatar images. Rather than provide their own bandwidth, they deep-link into his site and use his bandwidth. Punks!

He now has his web server restrict images from being served unless they’re referred to from a local page, but I never knew how to set it up. I just happened to come across the how-to here. The .htaccess changes look like:

    SetEnvIfNoCase Referer "^http://my.host.com/" local_ref=1
    <filesMatch ".(gif|jpg)">
        Order Allow,Deny
        Allow from env=local_ref
    </filesMatch>

Haven’t tried it myself yet, but made a note.

1 Comment

  1. Steve Leung 11 years ago

    I’m not saying anyone should do this, but it would be funny if instead of blocking the bandwidth theft, you just replaced the image with something that they wouldn’t want to use as their own avatar.  The possibilities are endless…