Custom Search

Proventing Image Hotlink for Wordpress-supported Blogs

Posted Aug 30, 2008 by Lindsay Britney

Share |


Needless to say why to block the image hotlink from a site, simply because of the need to prevent someone to steal its bandwidth (thus save the extra money for the webhosting).

Wordpress gurus please ignore this entry, as the post here is only intended for those newbies who just host their wordpress.org-supported blogs on a web host and want prevent other bloggers hotlinking their images.

Follow the steps below and make your images only available to your own site and let search engines, like Google, Yahoo and Msn, to index.

  1. Log in your FTP client, here we recommend to use FileZilla (it’s open source, and versatile)
  2. Locate “Server” menu, and click “Force showing hidden files”
  3. Doube-click the the site root directory in the FileZilla panel, like this site, it’s hollywoodcelebgossips.com.
  4. Find a file named .htaccess
  5. Download it to the desktop and open it using Notepad, you are now getting the default Wordpress .htaccess file.
  6. Insert the code in Step 7 below the line of “RewriteRule . /index.php [L]" obtained from the default file in this step.
  7. RewriteEngine On
    RewriteCond %{REQUEST_FILENAME} .*jpe?g$|.*gif$|.*png$ [NC]
    RewriteCond %{HTTP_REFERER} !^$
    RewriteCond %{HTTP_REFERER} !hollywoodcelebgossips\.com [NC]
    RewriteCond %{HTTP_REFERER} !google\. [NC]
    RewriteCond %{HTTP_REFERER} !live\. [NC]
    RewriteCond %{HTTP_REFERER} !yahoo\. [NC]
    RewriteCond %{HTTP_REFERER} !msn\. [NC]
    RewriteCond %{HTTP_REFERER} !search\?q=cache [NC]
    RewriteRule .* - [F]

  8. Say if your URL is www.example.info, replace “hollywoodcelebgossips” and “com”, with “example” and “info”, respectively, in the fourth line of the code above.
  9. Save .htaccess file in Notepad and upload it to your site root directory in FileZilla panel.
  10. When prompted if to overwrite the existing file with the same name, click “Yes” in the pop-up window.
  11. You make it! The images will only appear on your own site, RSS readers and some time later search engines’ image search will bring you the traffics.

If wanna know how to tweak .htaccess file for non-wordpress supported blogs/sites, please visit WalkerNews.net’s Image Hotlinking Prevention With Apache Mod_Rewrite which is also the inspiration of writing up this tip.



#Permalink Tags: , , , , ,
Your Ad Here

Read Also:

Your Ad Here

3 Responses to “Proventing Image Hotlink for Wordpress-supported Blogs”

  1. admin Says:

    Update: some may find this post due to Google’s Image Search

  2. Abby Bob Says:

    Bloggers need images but many of them don’t how to do image job properly. So they hotlink without permission.

    To address this issue we build a website acobox.com that allows users to hotlink images that it hosts. So, in addition to ban people from hotlinking from our sites, we may tell them: go acobox.com if you need free, hosted images – hotlink acobox as much as you like but don’t touch my site :-)

  3. admin Says:

    Hi, bob,

    I checked your site and found parts of your Hotlink License states:

    You CANNOT use the image in any other manner except hotlinking it. For examples but not limited to: You cannot do copying or download the image; You cannot distribute or republish the image; You cannot remix or modify the image for derivate work.

    As most of your pics are easily found via Wikipedia Commons search, I think, a lot of bloggers may download the pictures they desired and directly link to the original source with due credits included in their posts. So how do you think they will only hotlink to your page?

Leave Your Smart Thoughts: