Friday, March 25, 2011


Let's say i own and i have webpage test.html accessible through and test.html is codes as

          <img src=""/>

Now when you load , image1 will be loaded from and not from So i have hotlinked image1 from my webpage to

             Since bandwidth is charged, and i have asked your browser to show that 500KB (lets assume) image1 from , is going to pay for that bandwidth , not Hence bandwidth theft.

            Http Referrer can be used to identify if image1 is being linked from any other site except If yes , then we can simply reject the request or do whatever you like.
How can we check the referrer? Well Conditional Rewrite rules can help.

RewriteCond %{HTTP_REFERRE] !^http://(www\.)?*$
RewriteRule \.*/image1.jpg$ /image/sucker.jpg [L]

Well , first condition checks if referrer is anything except our website, if yes then next rewrite rule is excuted and alternate image is sent instead of image1.jpg, You can as well return 404 , a low bandwidth image etc

No comments:

Post a Comment