Hotlink Protection
Image from Hosting Services: Hotlink Protection

Bandwidth theft or "hotlinking" is direct linking to a website's files (images, video, etc.). An example would be displaying a JPEG image you found on someone else's web page so it will appear on your own site, journal, weblog, forum posting, etc.

Bandwidth refers to the amount of data transferred from a website to a user's computer. When you view a webpage, you are using that site's data transfer to display the files. Since web hosts charge based on the amount of data transferred, bandwidth is an issue. If a site is over it's monthly bandwidth, it's billed for the extra data or taken offline until the owner of the site upgrades the account.

By preventing hotlinking on your site, other sites will not be able to link to your images. If you don't prevent this and come across a site that is linking to your images, you can do a "switcheroo". (Change the image that they linked to an offensive image or one that lets them know they are hotlinking.)

To enable hotlink protection on your site, open up your .htaccess file and add the following to the next available line. (Please refer to the Introduction to .htaccess files tutorial to find out how to use and create .htaccess files.)

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

If you would like to enable hotlink protection on specific domains only, use the following code. (You will need to add each domain.)

RewriteEngine On
RewriteCond %{HTTP_REFERER} ^http://(www.)?othersite.net/ [NC,OR
RewriteCond %{HTTP_REFERER} ^http://(www.)?othersite.com/ [NC
RewriteRule .(jpe?g|gif|bmp|png)$ images/nohotlink.jpg [L]

Finally save the .htaccess and upload it to your server; most likely in the root directory. Remember that .htaccess files will apply in all subdirectories below it.


Close    To Top
  • Prev article-webmaster:
  • Next article-webmaster:
  • Now: Tutorial for Web and Software Design > Webmaster > Web Hosting > webmaster Content
    Photoshop Tutorial
     

    Special Effect

      3D Effect
      Photoshop Articles
    Programming Tutorial
     

    C/C++ Tutorial

      Visual Basic
      C# Tutorial
    Database Tutorial
     

    MySQL Tutorial

      MS SQL Tutorial
      Oracle Tutorial
    Geek Tutorial
     

    Blogging Tutorial

      RSS Tutorial
      Podcasting Tutorial
    Graphic Design Tutorial
      Coreldraw Tutorial
      Illustrator Tutorial
      3D Tutorials
    Webmaster Articles
     

    Domain Service

      Web Hosting
      Site Promotion
    Java Tutorial/ Articles
     

    Java Servlets

      JavaEE Tutorial
     

    JavaBeans Tutorial

    XML Tutorial/ Articles
     

    XML Style

      AJAX Tutorial
      XML Mobile
    Flash Tutorial/ Articles
     

    Flash Video

      Action Script
      Flash Articles
    OS Tutorial/ Articles
      Linux Tutorial
      Symbian Tutorial
      MacOS Tutorial
    Personal Tech
      Hardware Tutorial
      Software Tutorial
      Online Auction