Did you receive a notice that you are hotlinking an image on someone else’s server and warned to stop doing it immediately? Would you like to prevent hotlinking of your image files with an htaccess file? Even on a cheap web hosting plan?
What is hotlinking and bandwidth theft?
Bandwidth theft or “hotlinking” is direct linking to a web site’s files (images, video, etc.). An example would be using an tag to display a JPEG image you found on someone else’s web page so it will appear on your own site, eBay auction listing, weblog, forum message post, etc.
Bandwidth refers to the amount of data transferred from a web site to a user’s computer. When you view a web page, you are using that site’s bandwidth to display the files. Since web hosts charge based on the amount of data transferred, bandwidth is an issue. If a site is over its monthly bandwidth, it’s billed for the extra data or taken offline.
A simple analogy for bandwidth theft: Imagine a random stranger plugging into your electrical outlets, using your electricity without your consent, and you paying for it.
How do I know I am hotlinking?
This is how you might display an image graphic file in the HTML on your own web page:
This tag tells the site to request the file image.jpg on the same server as the rest of the files on the site. If you were to hotlink an image from an outside server, the HTML might look like this:
This tag tells the site to request the image.jpg from a different server other than your own. Every time the page is loaded, the outside server has to use its bandwidth to display the image. To avoid this problem, don’t link to files on servers that don’t belong to you. To share images and files on your own web page, upload them to your own server’s directory or to a free image hosting service that allows direct linking.
Why should I stop hotlinking?
Hotlinking can have a lot of undesirable consequences. One is the so-called “switcheroo”. If you’ve linked to an image on someone’s server, what’s to prevent them from changing the image you linked to? This can have humorous results. Since most sites, forums, etc. have strict policies about offensive images, it wouldn’t take much for an aggravated webmaster you’ve been stealing bandwidth from to shut you down completely with an unwanted “switcheroo”.
Displaying an image or file that doesn’t belong to could be a violation of copyright, making you open to litigation. The owner of the file could utilize DMCA law to have your site shut down and your information given for use in legal proceedings.
How can I prevent hotlinking?
Using a .htaccess file to prevent image hotlinking is a powerful measure to protect your website’s content and bandwidth. By configuring the .htaccess file, you can block unauthorized websites from directly linking to your images, ensuring that your valuable resources are only accessible through your own website, thus safeguarding your server resources and preserving your content’s integrity. With this simple yet effective solution, you can maintain control over how your images are used and enhance the overall security and performance of your website.