How to Prevent Image Hotlinking

Posted on August 11, 2015

Well, the technical part is pretty easy – and just a quick Google search away. There are even online tools that give you the code you need.

The fun part is – what data do you send to the perpetrators.

Now, it doesn’t seem like you can really do much harm. Yes, the obvious thing to do is to show an image that says “Please host your own images”. Some people may not even know how bad hotlinking is (for example, when you run a small VPS and you have to support a heavy traffic of several much larger websites). Sometimes, the people running a website don’t even know they are hotlinking; they just used a free WordPress theme that came with the offending code.

Well, in my case, I knew people had to go out of their way to get the images, so I thought I’d give them a bit of a lesson.

At first, I thought I’d redirect the traffic to a large file that would slow down their websites. It turns out it’s not easy to find a free image hosting that supports files over 900MB. Bummer.

So my second idea was to rickroll them.

This was fun and all, but then I wondered – can I do better? Is there a way to use my situation to make the world a better place? Of course!