Knowledgebase: Tips & Tricks
Hotlink Protection Tutorial
Posted by Support on 20 December 2007 04:38 AM
What is hotlinking and bandwidth theft?

Bandwidth theft or "hotlinking" is direct linking to a web site's
files (images, video, etc.). An example would be using an
<img> tag to display a JPEG image you found on someone else's web page so it
will appear on your own site, eBay auction listing, weblog, forum
message post, etc.
                  
Bandwidth refers to the amount of data transferred from a web site to a
user's computer. When you view a web page, you are using that site's
bandwidth to display the files. Since web hosts charge based on the
amount of data transferred, bandwidth is an issue. If a site is over
its monthly bandwidth, it's billed for the extra data or taken offline.
                  
A simple analogy for bandwidth theft: Imagine a random stranger
plugging into your electrical outlets, using your electricity without
your consent, and you paying for it.

Why should I stop hotlinking?

Hotlinking can have a lot of undesirable consequences. One is the so-called "switcheroo". If you've linked to an image on someone's server, what's to prevent them from changing the image you linked to? This can have humorous results. Since most sites, forums, etc. have strict policies about offensive images, it wouldn't take much for an aggravated webmaster you've been stealing bandwidth from to shut you down completely with an unwanted "switcheroo".
                  
Displaying an image or file that doesn't belong to could be a violation of copyright, making you open to litigation. The owner of the file could utilize DMCA law to have your site shut down and your information given for use in legal proceedings.
                  
How can I test to see if my image can be hotlinked?

Use our URL hotlink checker below to check the hotlinking protection (such as an htaccess file) on your web site. Enter the complete URL below (ex: http://mysite.com/image.jpg) to see if your image can be loaded and hotlinked by an outside server.

Click to go to the Resource & Test Page

Hotlink Protection Enabled via .htaccess File

-Create a new TXT file named *'sample.htaccess' and open it with your text editor (NotePad). *Windows users won't be able to create it as '.htaccess' so you have to rename 'sample.htaccess' to '.htaccess' after it's been uploaded to your server.

-Copy and paste the following lines to 'sample.htaccess' file:

               
RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://www.yourdomain.com/.*$      [NC]
RewriteCond %{HTTP_REFERER} !^http://www.yourdomain.com$      [NC]
RewriteRule .*\.(jpg|jpeg|gif|png|bmp|swf)$ http://www.yourdomain.com/forum/ [R,NC]


- Change http://www.yourdomain.com with your domain name.
- Upload 'sample.htaccess' file to your web server's root and rename it to '.htaccess'.
(1202 vote(s))
Helpful
Not helpful

Comments (0)