Website Owner’s Complete Guide to Hotlinking

By May 12, 2017Website Building

hotlinking hot link hotlink imageHotlinking is a way of displaying images on your website without hosting them on your server. Using simple HTML you can code your site to display images hosted elsewhere. There are a number of benefits to hotlinking, but also considerable drawbacks. Our quick guide will explain everything you need to know about what hotlinking is, when to do it, and why it can be a bad idea.

Hotlinking 101

Websites need images. Whether you want to display products in your estore, or illustrate a blog post, you need a way to display them on your site. Most site owners upload images and store them on their server. This requires server space, and uses the site’s bandwidth every time somebody visits the site. For small sites with only a couple of images per page, that’s not a big deal. For very image-heavy sites, or sites with lots of visitors, you can quickly hit your bandwidth limit.

Hotlinking is a way of displaying images without storing them on your server, or using your bandwidth to display them. Using HTML code, the website directs browsers to import and display an image from a different site. This can make your website cheaper and faster.

Hotlinking sounds great!

There are clear advantages to hotlinking images. Some sites now exist to cater to this practice. Image hosting platforms such as Flickr and Photobucket have quick links and preset HTML code for users to display uploaded images through hotlinks. A lot of forums save space on their servers by requiring users hotlink images, rather than upload them directly. Some archives, like Wikimedia Commons, also allow hotlinking.

What are the downsides?

Just because a site allows hotlinking doesn’t mean it’s always a good idea. Wikimedia itself warns people against hotlinking its content. That’s because anyone can edit the content, meaning any image you link to can be altered, switched out for something else, or deleted entirely. Very quickly you can end up with a website full of irrelevant or even offensive images, or a series of dead links.

And that’s just for the sites where hotlinking is permissible. Images are subject to copyright and hotlinking doesn’t circumvent that fact. Even if the image itself isn’t copyrighted, somebody still has to pay for the bandwidth. If you hotlink an image from somebody else’s website on a blog post that goes viral, you could use up their entire bandwidth and rack up a bill of hundreds or even thousands of dollars in their name. Then of course there’s the other downside—having somebody do that to you.

Is someone hotlinking my images?

The first step is to monitor your bandwidth for any unusual activity. If you suspect hotlinking, information about where hits and downloads come from are available in your access logs. Use software like AWStats to drill through the logs rather than wading through code yourself if you’re not code-savvy. Files with significant or unusual bandwidth usage have likely been hotlinked.

How to stop it happening

If someone has hotlinked your image(s), the easiest way to stop them is to delete or rename the image. This changes the image location from the one the hotlink is pointed to, and will result in a dead link on the linker’s side. If the site hotlinking from you is more popular than yours, you can always harness the link by switching out the image for an ad for your site!

To stop all hotlinks, past and future, you’ll need to alter your .htaccess file. A few lines of code are all you need to prevent hotlinking and replace links with a 403 Forbidden error message.

RewriteEngine On
RewriteCond %{HTTP_REFERER} !^http://(.+\.)?yoursitehere\.com/ [NC] RewriteCond %{HTTP_REFERER} !^$
RewriteRule .*\.(jpe?g|gif|bmp|png)$ – [F]

How to check if I’m hotlinking

It’s always possible that in the past you hotlinked an image or two without considering the implications. If you want to find and remove them, look in the HTML for the image. If the code points to “image_name.jpg” then the image is hosted on your server. However if it points to “http://notmysite.com/image_name.jpg” then you’re linking from elsewhere. If that site isn’t a photo sharing service or archive, it’s a hotlink.

Conclusion

Hotlinking can be a useful tool for keeping your site running quickly and your bandwidth use low, but it comes with a variety of pitfalls. Keep your site safe and secure both by avoiding linking from others, and editing your .htaccess file to prevent them from hotlinking you.

Join the discussion One Comment

Leave a Reply