Hotlinking and its discontents

al filreis's website

Hot Linking: Process by which one links to an image stored on one site yet it appears on one or more other sites. If done without permission, this is considered unethical since one is using bandwidth they [sic] are not paying for. — 2020 Systems Internet Glossary

Al Filreis is Kelly Professor of English, Faculty Director, the Kelly Writers House, and Director, the Center for Programs in Contemporary Writing at the University of Pennsylvania. Why did his page on Wallace Stevens, shown above, for a time feature a picture of naked David Haselhoff playing with puppies?

It’s not a bold new take on Stevens. Instead, it’s an illustration of the perils of hotlinking. If you link on your blog or website to an image hosted on someone else’s site you lay yourself open to the old switcheroo. Filreis — ignoring issues of copyright and net courtesy — thought he would take a free ride on someone else’s bandwidth. That made him no friends with the host of the copyrighted image of Wallace Stevens, who switched it to one of Hasselhoff.

That possibility alone should be reason enough not to hotlink; there are others as well. If you want to prevent hotlinking you can use set only certain sites to link to your images using cpanel, but I would rather just edit .htaccess, as described around the web in several places, such as the one shown below (click to go to the source). The second procedure shown below describes how you can serve up an alternate image to a particular site without having to rename your image and update your links.

how to prevent hotlinking using htaccess

← Previous post

Next post →


  1. Heh. I must remember that Hasselhoff trick. 😀

  2. So, if I post a link back to your blog so that you get credit that’s due you for an article, etc, I’m hotlinking and it’s a no-no? How then do I give the appropriate reference and/or credit to the original article or writer?

  3. Tom, have you ever had the feeling that some people don’t read your blog posts before commenting…? 😉

  4. No no, Nancy, that’s just linking. It would only hotlinking if you ran some picture on your blog and instead of hosting the image yourself you made the image appear on your site with code like [img src=somebody-else’s-website], where you are making somebody else host the image (not a link to the image, but the image itself) that appears on your site.

    I hope that’s clear. I’m afraid I’m not explaining it very well.

  5. OK – I didn’t realize the difference, being a painter and not a geek. Thanks for the explanation.

  6. Tom,

    I tried that .htaccess trick. Unfortunately it removed every image in every post throughout my blog. I double and triple checked the entry you show but the results were always the same. Go figure. Thanks for the info anyway. Do you still use .htaccess to keep other sites from hotlinking images?

  7. Kirk, I’ll check this out when I get home.

  8. Thanks Tom, Much appreciated.

  9. Kirk, I can only get this to work universally (except for specified sites exclusions), and not for just one particular site.

    Here is a very good explanation of using .htaccess to prevent hotlinking. It includes directions for making sure all variants of your own URL and other authorized referrers will be excluded from getting your alternate image (this was perhaps your problem).

  10. Excellent post. Very clear, yet detailed. You touched on cPanel’s anti-leaching feature. It is indeed very handy for anyone who can’t edit (or is not sure how to edit) their .htaccess file.