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.

This entry was posted in FamilyTree, Website and tagged , , . Bookmark the permalink.

3 Responses to Revamping a website and preventing hot-linking

  1. Pingback: Recent Links Tagged With "hotlinking" - JabberTags

Comments are closed.