Why it never hurts to double-check your hotlink protection
If you’ve owned a website for any period of time, chances are good you understand the importance of hotlink protection. Thousands of leechers hotlinking can take down the fastest of servers and rack up huge bandwidth bills. I’ve always made sure to set up hotlink protection of my sites, but was surprised yesterday to find that one of my sites was gobbling up bandwidth.
This particular site, a WordPress blog, normally uses 2GB of data transfer in a month, but had gone through 6GB and was using quite a bit of memory. As it turns out, I had forgotten to setup hotlink protection after switching server providers a few months ago. I was lucky to catch the problem before it became much worse. Lesson learned– it never hurts to double-check your hotlink protection.
How to prevent hotlinking

Also known as inline linking, hotlinking occurs when someone else uses a picture or video from your site somewhere else on the web, but doesn’t bother to host the content themselves. These “free riders” can hog precious bandwidth and in some cases, cause server instability.
Fortunately, hotlinking is very easy to prevent. A number of web hosts and control panels provide opt-in hotlink protection to users, including cPanel. You can also stop hotlinking by adding the following code to your .htaccess file:
RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?yourwebsite.com [NC]
RewriteRule \.(jpg|jpeg|png|gif)$ – [NC,F,L]
This code will block other websites from hotlinking your images. As you can see from the code, it is very easy to adjust the file types blocked.
Photo | Flickr
The Horror of Hotlinking

Find yourself using too much bandwidth? While the pictures and video content many of us host on our sites use a fair bit of data transfer, a hidden threat may be hogging more resources than you realize.
Also known as inline linking, hotlinking occurs when someone else uses a picture or video on your site somewhere else on the web, but doesn’t bother to host the content themselves. An example might be some taking an image located at http://www.yourwebsite.co.uk/yourimage.jpg and placing it on their website, but instead of uploading the file to their own server, leaves the URL as-is.
A victim of hotlinking can lose gigabytes of bandwidth this way. Often times, those responsible for the problem are unaware of the damage they are causing. A good deal of hotlinking occurs on forums and personal blogs, for example, where many users aren’t tech-savvy enough to realize what they’re doing.
The good thing is this danger is very easy to prevent. Many hosts, including all those using cPanel, offer some form of built-in hotlink protection that can be enabled in the control panel. You can also configure your .htaccess file to block hotlinkers.
Photo: Flickr
Tag: bandwidth, data transfer, hotlinking