The latest issue of A List Apart has a great article by Thomas Scott titled Smarter Image Hotlinking Prevention. In it, Mr. Scott presents a decent method to prevent folks from leeching media files from your site by using the .htaccess file and a php script.

When I redesigned my site early this summer, my goal was to make it strictly adherent to web standards. There are many advantages to this (see Zeldman’s Designing with Web Standards or Cederholm’s Web Standards Solutions), but one of the most appealing is bandwidth conservation. Sites that validate according to web standards are much slimmer as far as code is concerned, thus making pages load quicker and saving bandwidth.

I’ve been frequently confirming these advantages by checking my site logs. While digging deep into the statistics, I noticed that there were a few jpg images that were getting an unusually high number of requests. It turns out that quite several message boards and about 25 livejournal users were including these images on their sites by hotlinking to the files hosted on my server. I didn’t think much of it at first. In fact, I was kind of flattered that someone would put up one of my images (some of them even have me in them) on their site. Still, since my site has a limited monthly bandwidth allowance, and after I added up that last month at least 150 megabits of my bandwidth went to loading my images on other people’s pages, I decided to do somethin’ about.

Now, as you may remember, my site content is under a Creative Commons 2.0 License. That means I let people use my photos, content, and so on for their own purposes with only a few restraints. I don’t care that these people put these pictures on their sites and message boards, I just can’t keep providing the bandwidth for it.

It wasn’t feasible to e-mail these people and ask them to host the image somewhere else because most of them don’t list their e-mail on these sites. That would mean that I would have to make the changes myself. Other methods I found for doing this would limit my ability to post my own pictures to message boards that I frequent. I didn’t want to lose that. . . I also didn’t want to prevent my images from being archived by Google and other search engines. Nothing seemed to get done what I wanted. . .

Until I read this article at ALA this morning. I think I’ll be implementing Scott’s method in the near future.

Posted Sunday, July 18th, 2004 at 2:19 am
Filed Under Category: General, Web-related
You can leave a response, or trackback from your own site.

0

Leave a Reply