Hotlink: What is it and how to avoid it?

Hotlinking is the act of using another website’s bandwidth by displaying one of your digital assets (such as an image, video, or audio file), on a different website via a direct web link.

When this occurs, the original website owner must cover and pay for these server resources every time a web browser wants to load and view the asset.

If you are a website owner or web user in general, you may have heard of the hotlink. Many webmasters consider it a bad practice because it can put websites at a significant disadvantage.

For example, the owner of the website B. found a funny meme in the website A. and decided to use it on his website. But instead of saving the image to his computer and uploading it again, the owner of website B links the image directly from website A to instantly display it on his site.

Even though people can see the meme on website B, the origin server still stores it. In other words, website A’s server resources are used every time a user views the linked image. If website B receives a lot of traffic, a significant amount of website A’s server resources will be used.

In this article we will explain why you should avoid hotlinking and how to stop doing it. For webmasters, we offer four methods to protect your websites from hotlinking: using hPanel, an FTP client, a content delivery network (CDN), and WordPress plugins.

Reasons to avoid Hotlinking

It is a fact that hotlinking is what affects website owners the most. For those who do, hotlinking may seem like an easy way to acquire website assets, but in reality, hotlinking can also hurt them.

Let’s go over the top five reasons why you should avoid hotlinking at all costs:

  • Reusing assets without authorization is unethical: reusing content assets without authorization is theft. Unless the content falls under the , you have to obtain rights and permission before using it on your site.
  • You would be leveraging the resources of another website owner and increasing their hosting costs: every time someone views a hotlinking image, it consumes the bandwidth of the origin server. Therefore, the author is stealing not only the content, but also the resources of the original owner’s website.
  • Hotlinking can have legal repercussions: hotlinking of copyrighted content can have legal and monetary consequences. If the original owner sends the infringer a notice of copyright infringement and the infringer does not respond, the original owner may file a lawsuit.
  • You have no control over the hotlinking linked file: an image linked through hotlinking is connected to the original website. If the original owner decides to modify or remove the content at any time, the changes will also be displayed on the offending website.
  • Hotlinking makes you look unoriginal and unprofessional: Due to the bad reputation of hotlinking, adopting this practice can give a bad image of you. People may assume that you lack originality and that you do not respect the rights of other users.
See also  How to Clear WordPress Cache: 6 Easy Methods

How to stop hotlinking?

Now that you’ve learned why you should stop hotlinking, you may be wondering what to do instead when you want to use images from other websites.

The most important thing is to make sure that you have been given permission to use the image. There are some images that you can acquire simply by asking the owner for permission. Others are under strict legal license, for example copyrighted photographs.

Once you’ve received permission or taken care of the legal process, you need to upload the file to your own hosting or use a third-party provider. For images, use an image hosting service like . This way, you won’t be stealing bandwidth from the original website owner.

If for some reason you can’t acquire the image you want, try these alternatives:

  • Look for a similar replacement: You may be able to convey the same message with a different image. For example, if there’s a specific photo you can’t find, try acquiring a similar photo from another source, such as a stock image bank like , and .
  • Link the page, not the image: If you can’t replace the image with a similar alternative, consider adding a link to the image’s original web page. You may not be able to display the image exactly the way you wanted, but your visitors will still have the opportunity to view it by clicking the link you’ve provided.

How to protect your site to avoid hotlinking?

It is very important to protect yourself from hotlinking to avoid problems related to content and bandwidth theft.

Before proceeding, please note that hotlinking protection will not harm your website’s presence in search results. As long as you don’t block search engines from indexing your images, your advertising efforts won’t be affected.

We are going to go over four different methods to protect your assets from hotlinking.

Method 1: Access hPanel Settings

If you host your website on , you can set up hotlink protection directly from . The process should be similar in other control panels. Follow these steps:

  1. Log in to your hosting account and go to the control panel.
  2. In OthersChoose hot link protection.
  1. In Block direct access to these extensions, choose which file extensions you want to protect. Once applied, visitors will not be able to see the direct links attached to the file extensions you have selected.
  2. In the countryside Redirect blocked requests to this URLyou have the option to enter the URL of an error page that you want to display to visitors who attempt to hotlink to your website.
See also  How to make an effective landing page

Method 2: Use an FTP client

Another option is to edit the .htaccess of your website, accessing it through an FTP client such as or the file manager of the control panel of your hosting account.

Keep in mind that this method involves editing your website’s code, so be careful: a small mistake can render your site unusable.

  1. Once you have connected to your website’s FTP or opened the file manager, navigate to the folder public_html.
  2. inside the folder public_htmlfind the file .htaccess and download it.
  3. On your computer, make a copy of the file .htaccess original in case something goes wrong.
  4. Open the .htaccess file with your preferred text editor.
  5. Copy and paste the following code into the file:

RewriteEngine on RewriteCond %{HTTP_REFERER} !^$ RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?google.com RewriteCond %{HTTP_REFERER} !^http(s)?://( www\.)?bing.com RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?yahoo.com RewriteCond %{HTTP_REFERER} !^http(s)?://(www\ .)?yourdomain.com RewriteRule \.(jpg|jpeg|png|gif)$ –

  1. change yourdomain.com by the real domain of your site.
  2. Save the file .htaccess edited and upload it back to the folder public_html.

Method 3: Use a CDN

Using one for your website has many advantages. A CDN can increase the speed of content delivery, providing better performance to your visitors. It can also offer asset management features for website administrators, hotlink protection being one of them.

The hotlink protection activation process will vary depending on the CDN provider you use. In the following tutorial we go over how to set up hotlink protection on two popular CDN providers: and .

Here’s how to activate hotlink protection on Cloudflare:

  1. Sign in to your Cloudflare account and navigate to the dashboard.
  2. Select the app Scrape Shield, which is located at right of the application bar.
  1. Activate the Hot link protection.

Cloudflare’s Scrape Shield app specifically prevents image hotlinking and supports file types: .gif, .ico, .jpg, .jpeg Y .png.

Here’s how to activate hotlink protection on KeyCDN:

  1. Login to your KeyCDN account and go to the control panel.
  2. Select Reference area in the sidebar.
  3. click on Add zone reference.
  1. Enter the URL of the referral zone. Zone referrers are the URLs that can see direct links to your website assets. URLs that are not included in the zone referrers will be blocked.
  2. Select the Zone in the dropdown menu.
  1. click on Add to save the settings.
  2. Do not hesitate to add several referents of the area.
See also  What is Python: know one of the most popular programming languages

Method 4: Use a WordPress plugin

If you use WordPress as (CMS) of your website, there are several that can prevent hotlinking. Let’s review three of them.

The first is the plugin, which can automatically edit the file .htaccess of your website to avoid hotlinks. Follow these steps to set it up:

  1. From the WordPress control panel, and activate it.
  2. Go to the menu of WPSecurity -> firewall -> Prevent Hotlinks.
  3. Select this option if you want to prevent hotlinking to images on your site.
  1. click on Save settings.

Another plugin you can use is . This plugin can block visitors from copying text or right-clicking on your website. If you enable right-click prevention, your visitors will not be able to find or save the direct link to your content files.

Here’s how to enable right-click protection on your website using this plugin:

  1. Install and activate the plugin.
  2. click on Copy Protection in the sidebar of your WordPress dashboard.
  3. Select the tab of Premium Right Click Protection.
  4. Select the types of pages you want to enable right-click protection on. You can allow it in Ticketsthe Homepage and others static pages.
  1. click on Save settings.

Another option to disable right click and asset copying is the plugin. Here’s how to set it up:

  1. Install and activate the plugin.
  2. In the WordPress dashboard, go to Copy Protection -> Options.
  3. Make sure that both the option Disable right-click Y Disable right-click for images are marked. Brand ShowMessage so that your visitors get a message when they try to right-click on your site.
  1. click on Save Changes.

conclusion

Hotlinking is the act of copying assets, usually images, by linking to the file directly from other websites without authorization.

It is a bad practice that negatively affects the administrators of a website. Hotlinking images from another website can take up a significant amount of bandwidth on your server and infringe on the copyrights of their owners.

We’ve explored different reasons why you should never hotlink and what you can do instead to…

Loading Facebook Comments ...
Loading Disqus Comments ...