Databloc - cpanel web hosting
Call us toll free at 1-888-210-1714

The leading provider of top quality cpanel web hosting services.

Databloc Homepage   Shared Web Hosting Reseller Hosting Domain Registration SSL Certificates

Support

Hot linking is where another site is using your images and your bandwidth. If you need to block other sites from directly linking in your images then this tutorial will do that.

What is Hot Linking?

Hot linking is when a someone uses the img tag to include an image on their site from your site. It’s just like your neighbor plugging in an extension cord at your house to provide electricity for their home. You’re paying for your own usage, and you’re paying for theirs. When someone hot links an image, it is shown on their web site but hosted on your's which takes up bandwidth.

How to Block Hot Linking

Firstly, you need to create an .htaccess file. An .htaccess file is a file to control the web server (the web server serves the images and files you see in your browser), this file needs to be uploaded into the public_html directory or any other directory within this one. For more information on creating an .htaccess file see our Introduction To An ".htaccess" File article.

Using a text editor like Notepad simply create a file called .htaccess (note, make sure there is no .txt extension) and add the following code into it:

RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://(www\.)?your-domain.com/images(/)?.*$ [NC]
RewriteRule .*\.(gif|jpg|jpeg|bmp)$ - [F,NC]

Note: You will need to change the "your-domain.com" to your own.

Now, using an FTP client you need to upload the .htaccess file into your root web directory (/public_html). The file must be transferred in ASCII (plain text) mode.

Testing Your New Hot Link Protection

Now try accessing a file in your images directory by directly typing in the full url into your browser, for example:

http://www.your-domain.com/images/picture.jpg

If hot linking is working you should see a broken image (red cross).
Web Hosting with cPanelPHP4, PHP5 and PHP6MySQLCGI, PerlEnhanced Frontpage ExtensionsRuby On Rails (ROR)Fantastico Enabled
Shared Web Hosting | Reseller Hosting | Domain Registration | SSL Certificates
Customer Support | Terms of Service | Acceptable Use Policy | About Us | Sitemap