English Czech

Stop Image Hotlinking – we have a quick tip, that can help you protect your server bandwidth. So if you are in situation that you find your pictures on another server, you can block this unwanted load.. and be happy again about your content, check this tips..

Stop Hotlinking with htaccess. Test your Image Hotlink Protection with our Hotlink Checker from altlab.com. – Would you like to stop hotlinkers? Is your web hosting bandwidth bill growing each month? No budget in getting a dedicated server? Want to test image hotlink protection for your web site? Here is information on using an htaccess file to stop hotlinking and bandwidth theft.

Example: Your site url is www.mysite.com. To stop image hotlinking from other sites and display a replacement image called qX4w7.gif from an image host, place this code in your .htaccess file:

RewriteEngine On
 RewriteCond %{HTTP_REFERER} !^http://(.+\.)?mysite\.com/ [NC]
 RewriteCond %{HTTP_REFERER} !^$
 RewriteRule .*\.(jpe?g|gif|bmp|png)$ http://i.imgur.com/qX4w7.gif [L]

To stop hotlinking from specific outside domains only, such as myspace.com, blogspot.com and livejournal.com, but allow any other web site to hotlink images:

RewriteEngine On
 RewriteCond %{HTTP_REFERER} ^http://(.+\.)?myspace\.com/ [NC,OR]
 RewriteCond %{HTTP_REFERER} ^http://(.+\.)?blogspot\.com/ [NC,OR]
 RewriteCond %{HTTP_REFERER} ^http://(.+\.)?livejournal\.com/ [NC]
 RewriteRule .*\.(jpe?g|gif|bmp|png)$ http://i.imgur.com/qX4w7.gif [L]

You can display a 403 Forbidden error code instead of an image. Replace the last line of the previous examples with this line:

RewriteRule .*\.(jpe?g|gif|bmp|png)$ - [F]

Test Image Hotlinking Protection
Stop Hotlinking and Bandwidth Theft. Test your Hotlinking Protection with our Hotlink Checker.


Graphic and website designer, currently, I attend to the maintenance of about thirty sites for existing clients as well as creating websites for the new ones. In my free time, I get into the secrets of the world of Linux, SSH, WP-CLI and I’m preparing this blog.

This Post Has 4 Comments

  1. Pingback: Tweet-Parade (no.16 April 2012) | gonzoblog.nl

  2. Pingback: Tweet Heat - The hottest Tweets of the Month [April 2012] | Inspired Magazine

  3. Pingback: Tweet Heat – The hottest Tweets of the Month [April 2012] « iTechTunes

  4. Pingback: Tweet Heat – The hottest Tweets of the Month [April 2012] | Web design blog

Leave a Reply

Pin It on Pinterest