Revamping a website and preventing hot-linking

Posted by Ian on 7th Jul 2008 at 4:43 pm
2008
7 Jul

It’s been a long time coming and at the end of last week I finally got around to revamping my family tree website. It used to be static pages that I hand-coded and hadn’t been updated for months. I have now converted it to a Wordpress blog (just like this one), which means I can add entries there when I’m researching one branch or other of the family tree.

In addition to re-launching this site, I had to add code on all my sites this morning when I found a Russian site that had basically taken and translated every post on my blog into Russian and was presenting it complete with all my (hotlinked) images and style sheet. I have now added code in my sites’ .htaccess file preventing hotlinking of images and my stylesheets from other sites. I checked David Airey’s blog post How to stop image hotlinking and bandwidth theft before adding the code.

RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://([a-z\.\-]+)?ianhedges.com/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://([a-z\.\-]+)?ijhedges.com/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://([a-z\.\-]+)?ijhedges.co.uk/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://([a-z\.\-]+)?cre8Buzz.com/.*$ [NC]
RewriteRule .(gif|jpg|png|css)$ - [F]

I’ve allowed cre8Buzz, as I hotlink my profile images from my gallery.

Tags:,,

2 Responses

  1. MyAvatars 0.2 David Airey UNITED KINGDOM Windows XP Mozilla Firefox 2.0.0.15 Says:

    Hi Ian,

    You might want to also allow Google.com in your htaccess code. This will keep images showing in both Google Reader and any Google image searches that show your files.

    All the best, buddy.

  2. MyAvatars 0.2 Ian UNITED KINGDOM Windows XP Mozilla Firefox 3.0 Says:

    Thanks David,
    I hadn’t thought of Google. After checking my 403 logs, I found I also needed to add feedburner.com. It is amazing to see where my images are used. I think I should have acted when I originally read your article.
    Regards,
    Ian

Leave a Comment




XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Please note: Comment moderation is enabled and may delay your comment. There is no need to resubmit your comment.

FireStats icon Powered by FireStats