Web Mastering 101 — Why You Should Keep Your Images Local
via Rob
Here’s an excellent reason why you should never, ever hotlink to images on someone else’s site. (Note - may no longer be funny once website owner clues in.)
I love it! Looks like something I would do to someone who torqued me off — except I might not be as kind! Almost as good as those bogus referrers being pushed off to the Office of Homeland Security (I decided the FBI was too mundane).
Post Revisions:
There are no revisions for this post.
September 6th, 2005 in
Geek Log

The thing is that I didn’t target that site in particular by subbing out the image. I just set up a redirect for anyone out there who inlines my graphics in their own site’s pages. I’m just tired of paying for bandwidth used to serve design elements for other people. The clowns over at myspace.com have hotlinked to a number of my photos that have, at times, cause utilization of 100+MB per day.
So, I dropped the following in my .htaccess file:
RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://.*rnovak.net/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://.*nikonians.org/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://.*cmpg.org/.*$ [NC]
RewriteRule .*\.(JPG|jpg)$ /assclown.gif
Basically, if it’s not from a site in my domain or a domain that I trust, any request for a JPEG used inline as an <img> tag from another site gets the “assclown.gif” file substituted.