What is hotlinking (data transfer/bandwidth theft) and how can I prevent it?
Hotlinking or bandwidth theft is when someone links directly to a file on your site. If a website was hotlinking to an image on our site, they may have the following in their HTML - <img src="http://www.plugsocket.com/image.gif" />. When the other website has visitors to the page containing that code, the image from our site would be displayed and the amount of data transferred would be our responsibility.
If you take a look at your site's statisics (found at http://www.example.com/admin) (replace example.com with your domain name) and your data transfer (bandwidth) usage is higher that you would expect it to be, you may wish to investigate some of the sites that are listed as your sites top referrers (click on Webalizer, then on the month, then on Referrers along top of page).
To prevent hotlinking, you can create a file named '.htaccess' and upload it to the directory that contains the files that you wish to protect. To prevent image files (.gif and .jpg in this example) from being directly linked to from any site other than plugsocket.com we would use the code below.
RewriteEngine On
RewriteCond % !^$
RewriteCond % !^http://(www\.)?plugsocket.com(/)?.*$ [NC]
RewriteRule .*\.(gif|jpg)$ - [F,NC]
If we only wanted to block a couple of sites (e.g. thief-one.com and thief-two.com) from using images (.gif and .jpg in this example) directly linked from our site, we could use the code below.
RewriteEngine On
RewriteCond % thief-one.com [OR,NC]
RewriteCond % thief-two.com [NC]
RewriteRule .*\.(gif|jpg)$ - [F,NC]
There should be no reason to need to take pre-emptive measures to prevent bandwidth theft.
Other Questions In This Category
- Is it possible to have extra allowance for data transfer (bandwidth)?
- What does bandwidth (data transfer) mean and what can I do if I have exceeded it?
- Do you suspend my site or send me an unexpected bill if I exceed my bandwidth limit?
- How much data transfer (bandwidth) do you think I will need?
- More Articles..