Revamping a website and preventing hot-linking
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.












![Validate my RSS feed [Valid RSS]](http://blog.ijhedges.com/wp-content/themes/ijhedges/images/valid_rss_80x15_2.png)
July 8th, 2008 at 7:44 am
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.
July 8th, 2008 at 6:08 pm
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