January 29, 2010

TEXT SIZE minus plus

Prevent Hotlinking (Save Bandwidth)

Advertisement
You Might Be Interested In Our Popular Article
  • Most Essential Free Softwares After Windows Installation
  • Many a times Bloggers run out of their monthly usage without even their articles getting many hits, resulting in a downtime or paying penalty for specific hosting. This might be a result of Hotlinking, this means that the images you are hosting on your site are used by other sites by inserting same links in IMG tags, which sucks your bandwidth.

    This simple tutorial will help you prevent this in a snap.

    For Advanced Users:

    Note: Do take backup of your .htaccess(hypertext access) file.

    01. Search for a file named .htaccess(hypertext access) in the webroot of your server (FTP) and can be easily edited using any text editor (like Notepad). Open it and add below code in it:

    Options +FollowSymlinks
    #Protect against hotlinking
    RewriteEngine On
    RewriteCond %{HTTP_REFERER} !^$
    RewriteCond %{HTTP_REFERER} !^http://(www.)?domainname.com/ [nc]
    RewriteRule .*.(gif|jpg|png)$ http://domainname.com/img/stop_stealing_bandwidth.gif[nc]

    02. Save and you are done.

    For Normal Users:

    You can download and install the below plugin for achieving such:
    WordPress Automatic Image Hotlink Protectionn

    Script Source:

    This concludes this simple and useful tutorial. Hope you like it.

    cover-action-pro
    Print

    About the Author

    We are team of professionals and are here to help you shift your Blogs to Wordpress. Visit our page to read more about our services Blogger to Wordpress Services.
    • This article has been shared on favSHARE.net. Go and vote it!
    • Connie
      A simple "do like that" without explaining the situation is not very helpful

      You should at least explain that all incoming requests for some image will show the image which is named in "http://domainname.com/img/stop_stealing_bandwidth.gif" so that "stop_stealing_bandwidth.gif" in the folder /img/ must exist, or better:

      that the call will present a defined image which must exist at the website instead of the called image
    • This technique works extremely well. My gallery is using Gallery2 which incorporates a wizard to set this up for you. Remember, that if you post links to facebook, for example, you need to allow facebook to be able to link. There are some good examples on the http://www.modrewrite.com/ -- modrewrite forums which is linked off of modrewrite.com. Good luck and be sure to test thoroughly!
    • The first method is fabulous. I love that.

      But when others link to my files with a ref url, can it still work? My site is temporarily down so can't try it right now. Has someone tested this?
    • Very useful... thanks!
    • Sweet, been looking for something like this for awhile. (Hits hand on forehead) I knew I should have checked for a Wordpress plugin :)
    • Thanks for the info!
    • Very useful tips.Stealing Bandwidth is bad, I don't know why people do it
    • This is just what I wanted. I am a victim of this bandwidth problem. Can u tell what exactly this does?

      I upload my pics on DropBox and import images to my blog. This method has been quite effective but even then eats away the bandwidth. I want to try this method out. Thanks for sharing.
    • Please read the reference link, that explains it all.
    blog comments powered by Disqus