A hotlink occurs when someone is directly linking content from your site to another site and uses your bandwidth to serve the files. For example, when someone is displaying an image hosted on your server on their own web pages. You can use this hotlink protection security feature in cPanel in order to prevent this from happening.
To enable hotlink protection in cPanel, follow the steps below.
To disable hotlink protection, click ‘Disable’. When you disable hotlink protection, the system deletes the entries in the List the URLs to which you wish to allow access list. We strongly recommend that you save the list locally before you disable hotlink protection.
If you are not using cPanel on your server, you can still enable hotlink protection easily through the .htaccess file. You’ll just have to use the following code snippet.
RewriteEngine on # Remove the following line if you want to block blank referrer too RewriteCond %{HTTP_REFERER} !^$ RewriteCond %{HTTP_REFERER} !^https?://(.+\.)?example.com [NC] RewriteRule \.(jpg|jpeg|png|gif|bmp)$ - [NC,F,L]
If you want to display a “blocked” image in place of the “hotlinked” image, replace the last rule with.
RewriteRule \.(jpg|jpeg|png|gif|bmp) https://example.com/blocked.png [R,L]
Victor Mochere is an award winning blogger, social media influencer, literati savant, altruistic, and a netpreneur creating and marketing digital content.
This site uses Akismet to reduce spam. Learn how your comment data is processed.
Permission to use quotation from any article is granted subject to full credit of the source being given by referencing the direct link of the article on Victor Mochere. However, reproducing any content on this site without explicit permission is strictly prohibited.
We are committed to upholding our editorial standards, including accuracy. Our policy is to review each issue on a case by case basis, immediately upon becoming aware of a potential error or need for clarification, and to resolve it as quickly as possible. If you notice an error or typo that needs correction, please don’t hesitate to contact us for immediate action.
Victor Mochere brings you a daily dose of well curated up to date facts, news, opinions and important updates from Kenya, Africa and around the World.
Copyright © 2021 Victor Mochere. All rights reserved.
Copyright © 2021 Victor Mochere. All rights reserved.