PHPKB Knowledge Base Software Logo Buy Now 
PHPKB 1.5 Knowledge Base Software
Knowledge Base Management Software  
Knowledge Base Home Knowledge Base Home | Knowledge Base Glossary Glossary | Contact Us Contact Us
Home > All Categories > Computers & Information Technology > Internet and WWW > How to Block Hot Linking and stop Bandwidth Hogging?
Question Title How to Block Hot Linking and stop Bandwidth Hogging?

What if another web site is stealing your images and your bandwidth by linking directly to your image files from their web site? This is called Hot-Linking. 'Hotlinking' is a commonly used term for when another website directly embeds your images in a web page or forum. The simplest way to stop this practice is to send a 403 ('Forbidden') response when the referer is not your own site or one that you do not want to be able to display your images.

Do you want to prevent hot-linking? This can prevent this by adding this code to your .htaccess file

RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://(www.)?yourdomain.com/.*$ [NC]
RewriteRule .(gif|jpg)$ - [F]

Replace yourdomain.com with your actual domain name. With this code in place, your images will only display when the visitor is browsing http://yourdomain.com. Images linked from other domains will appear as broken images.

The next change you can make is to let your images be seen when your pages are viewed from a 'webmail client', 'search engine cache' or 'web-based translator'. For example, to display images for people using Google's [Cached] feature, add the following condition:

RewriteCond %{HTTP_REFERER} !q=cache

Want to show a ?Image Stealing is Bad? message too?

You can even provide an alternative image to display on the hot linked pages. For example, an image that says ?Image Stealing is Bad. Visit yourdomain.com to see the real picture that belongs here.? Use thes code below in your .htaccess file to accomplish that however please note that the donotsteal.gif image will still be loaded from your server so bandwidth is still used for this image.

RewriteEngine On
rewriteCond %{HTTP_REFERER} !^$
rewriteCond %{HTTP_REFERER} !^http://(www.)?yourdomain.com/.*$ [NC]
rewriteRule .(jpe?g|gif|png|bmp)$ dontsteal.gif [L]

This time, replace yourdomain.com with your domain name, and replace dontsteal.gif with the file name of the image you?ve created to discourage hot linking.

Posted by: Administrator This question has been viewed 3264 times so far.

Want More?
Would you like to be notified when new articles are added to our knowledgebase? Subscribe to our Feed and get instant notifications when new articles are added to the knowledgebase.

Click Here to View all the questions in Internet and WWW category.
File Attachments File Attachments
There are no files attached to this question/article.
How helpful was this article to you?
User Comments User Comments Add Comment
There are no user comments for this question. Be the first to post a comment. Click Here
Related Questions Related Questions
  1. New Internet that's 10,000 times faster
  2. OpenLaszlo - What is OpenLaszlo?
  3. Hotmail founder set to take on Microsoft and Google with an online office productivity suite
  4. Airtel Offers 8 Mbps Broadband Connection in India
  5. Get a yourname@live.com email address
  6. Real Estate Directories - List of Real Estate Resources
  7. Multi-Language Domain Names Coming Soon
  8. Top 10 Free Email Services
  9. What do domain extensions mean?
  10. How to use WiFi?
  11. Microsoft Popfly - Online Gadget and Page Maker
  12. Important Internet Tips for Parents and Families
  13. Angry with some website? Spill Coffee on it
  14. Online GUID Generator - Generate GUID Online
  15. Three ways to Save Video from the Internet
  16. Country Coded Top Level Domains (TLD)
  17. Website Statistics Couldn't Have Been Better
Article Information Additional Information
Article Number: 376
Created: 2007-07-04 2:14 AM
Rating: 5 Stars
 
Article Options Article Options
Email Article to Someone
Export to Adobe PDF Export to PDF File
Bookmark Article
del.icio.us Bookmark del.icio.us Bookmark
Reditt Bookmark Reditt Bookmark
Digg Bookmark Digg Bookmark
StumbleUpon Stumble It
Subscribe to Article
Twitter
Feedburner Stay Informed by Email
 
Search Knowledge Base Search Knowledge Base
 
 
Related Articles Related Articles

Related New Internet that's 10,000 times faster

Related OpenLaszlo - What is OpenLaszlo?

Related Hotmail founder set to take on Microsoft and Google with an online office productivity suite

Related Airtel Offers 8 Mbps Broadband Connection in India

Related Get a yourname@live.com email address

Related Real Estate Directories - List of Real Estate Resources

Related Multi-Language Domain Names Coming Soon

Related Top 10 Free Email Services

Related What do domain extensions mean?

Related How to use WiFi?

Related Microsoft Popfly - Online Gadget and Page Maker

Related Important Internet Tips for Parents and Families

Related Angry with some website? Spill Coffee on it

Related Online GUID Generator - Generate GUID Online

Related Three ways to Save Video from the Internet

Related Country Coded Top Level Domains (TLD)

Related Website Statistics Couldn't Have Been Better

 
 

Powered by PHPKB Knowledge Base Software