If you read my previous post on hotlinking, you may be wondering how you can block these offending sites. Often, enabling hotlink protection will break your newsletters and feeds, so I recommend blocking individual sites.
To block specific sites:
- Open up your cPanel and visit the File Manager once again. This time, select Web Root in the pop up box. Also, check the “Show Hidden Files (dotfiles)” box.
- Select the .htaccess file and click Edit. Click Edit again in the pop up box.
- Insert the following code at the very top of the file. Replace the domain as necessary. For example, if google.com were hotlinking your image, enter google.com
- Repeat for other offending domains and save the file.

# Hotlink Protection RewriteEngine On RewriteCond %{HTTP_REFERER} ^http://domainhere.com/ [NC,OR] RewriteCond %{HTTP_REFERER} ^http://(.+\.)?domainhere\.com/ [NC] RewriteRule .*\.(jpe?g|gif|bmp|png)$ - [F] |
This is what the code has done. Here’s the image before:

And here’s what it looks like after:
As you can see, the image is not being displayed, and is not using any bandwidth.
Don’t know how to find out if your images are being hotlinked? You can find out through a simple AWStats hack.

[...] block your image from appearing on their site. This is a separate topic and will be covered in an upcoming post.Filed Under: htaccess, WordPress · About Mitchell WischmannMitchell is a senior in high [...]