As a website owner, you should know what hotlinking is, which is a bad practice that can harm a website. Hotlinking will increase resource usage, which can have an impact on decreasing website performance.
In SEO, hotlinking is considered a blackhat SEO action . To prevent hotlinking, let’s read this article.
What is hotlinking?
Hotlinking is known as a practice carried out by irresponsible parties to link directly to files in the form of images or videos that are then hosted on other websites without the permission of the website owner. So, they do not download the file and upload it to the server, but use the URL directly from the file source.
This method can result in unauthorized bandwidth usage for the site owner, potentially slowing down the site. This action can also result in additional costs being charged for hosting on the victim’s website.
Not only that, the practice of hotlinking makes site owners lose control over how and where their content will be displayed. Of course, this is detrimental to website owners for their digital assets.
The Impact of Hotlinking on Websites
When you share content publicly, anyone can access it. Unfortunately, this can cause problems for your website. Before you know what hotlinking is, you may not realize it.
Did you know that the digital assets of the site can be accessed by everyone without exception? To limit access to the digital access that you share on the website, you can apply hotlinking protection. That way, only those who are authorized can access it.
Becoming a victim of hotlinking can have negative impacts on website owners, including:
- Site page loading time becomes slow
- Risk of increasing hosting costs
- Excessive use of server resources
After knowing what hotlinking is and its negative impacts on the website you manage, of course you have to be more careful. There are many ways to prevent your website from being affected by hotlinking. That way, you can protect bandwidth usage and maintain optimal website performance.
Here are some ways that can be done to prevent hotlinking:
Using a Content Delivery Network (CDN)
From the explanation of what hotlinking is, you can conclude why this action should be prevented. One preventive measure that can be taken is to use a CDN. CDN stands for Content Delivery Network which works by distributing website content to various content around the world.
CDN can speed up user access and reduce the load on the original server. Using a CDN also allows you to implement security rules such as hotlink protection that can restrict other sites from accessing files outside the authorized domain.
That way, only domains that have permission can display content. This can also prevent unauthorized bandwidth usage. Using a CDN is very useful in protecting digital assets, thus helping site owners avoid content misuse.
Adding Code to .htaccess file for Apache Server
If you want to prevent hotlinking, you should immediately add code to your hypertext access file that can be accessed via an FTP client or file manager.
The code to add is:
RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://(www.)example.com/.*$ [NC]
RewriteRule .(gif|jpg|jpeg|bmp|zip|rar|mp3|flv|swf|xml|php|png|css|pdf)$ – [F]
Then replace “example.com” with your website domain name.
Make Sure Right Click Function is Inactive
What is hotlinking is not a trivial matter. Your website can experience several risks after such actions. That is why site owners must take precautions.
There are many ways to do this, such as making sure the right-click function is disabled, so that no one can use it when accessing content on your site. By disabling right-click, users cannot easily copy the URL of an image or other file from your site, thus preventing them from doing hotlinking.
This implementation is usually done using simple JavaScript code or a plugin if you’re using a platform like WordPress. While it doesn’t completely prevent hotlinking, it can be an additional barrier that helps protect content from abuse and reduces unwanted bandwidth usage.
Changing File Names Periodically
Preventing hotlinking by periodically changing file names is one effective strategy. Hotlinking occurs when a file, such as an image or video, is used on another site without permission. By periodically changing the names of these files, the links used by the other site will become broken, making the content unavailable.
This process requires proper file management and internal updates to your site. This is to ensure all links remain functional. While a bit of a hassle, this method can reduce unwanted bandwidth usage and protect content from abuse.
Add Watermark to Every Uploaded Image
After understanding what hotlinking is, one of the preventive measures that can be taken to avoid becoming a victim is to add a watermark to every image you upload. A watermark is a sign or logo placed on top of an image, indicating original ownership. With a watermark, if your image is hotlinked by another party, the identity and original source of the image remain visible.
It can also reduce the incentive for others to use the image without permission, since the watermark makes the image look less professional when used on other sites. This process not only protects copyright, but also helps maintain the visual identity and credibility of the website.
Restricting Access via CORS
Preventing hotlinking can be done by restricting access using CORS (Cross-Origin Resource Sharing). CORS is a mechanism that controls how resources from one domain can be accessed by scripts in other domains. By configuring your server to only allow access from certain domains, you can prevent hotlinking.
Add a CORS header on the server, such as Access-Control-Allow-Origin: example.com
, to allow only that domain to access the content. This prevents other domains from hotlinking and protects bandwidth and resources.
Installing Hotlinking Prevention Plugin
One effective way to do this is to install a hotlinking prevention plugin. These plugins work by blocking direct access to images, videos, or other media files from other sites, so that only genuine visitors to the site can see them. Many plugins are available for popular platforms like WordPress, and can be easily set up without requiring in-depth technical knowledge.
With this plugin, you can keep your site performing optimally and protect your content from abuse.
Blocking IP Address
Increasing website traffic is something that site owners hope for. However, if it happens in a spike, you should do a site analysis. It could be that the traffic is only coming from a few sites that aim to perform hotlinking actions on images or other files on your site.
Try renaming the file. Then, proceed to issue a removal request, and block the IP address. If you find the same IP address repeatedly trying to hotlink, immediately block the domain as a follow-up action.
Reporting Hotlinking to DMCA
As one of the actions that can be taken if you become a victim of hotlinking is to report it to DMCA. This can be the right action in overcoming and preventing the same action from happening in the future.
Identify the sites that are hotlinking your content. Gather evidence such as URLs and screenshots. Then, visit the DMCA website and file a complaint through the takedown form. Include details about the violation and copyright.
The DMCA will contact the infringing site to remove the content involved. This process can reduce the negative impact of hotlinking by protecting bandwidth and maintaining content integrity. Be sure to monitor your site regularly and use monitoring tools to detect hotlinking early.