How to enable hotlink protection using .htaccess

When an outsider tries to insert any content from your site into another competitor’s website and eventually consumes your site bandwidth to serve their files, this unethical breach is thought of as a Hotlink.

Hotlink Protection means protection of your static files from being linked directly. By enabling hotlink protection can save server bandwidth. .htaccess is being widely wont to tweak configuration settings of Apache Web Servers. It also can be wont to enable hotlink protection of your Website. Let’s learn the way How to enable hotlink protection using .htaccess.

How to enable hotlink protection?

Open your .htaccess on an editor. Add the below codes in it.

Options +FollowSymLinks 
RewriteEngine on 
RewriteCond %{HTTP_REFERER}!^https://(.+\.)?yourwebsite\.com/[NC] 
RewriteCond %{HTTP_REFERER}!^$ 
RewriteRule .*\.(jpg|jpeg|gif|bmp|png|swf)$-[F]

Join Our Whatsapp Group

Upcoming hosting and SSL offers and news updates here. We can try to solve your doubt regarding any problem like Domain, Hosting, SSL certificate, etc. And News update here.

Also Read: How to Redirect HTTP to HTTPS Using. htaccess?
Also Read: How To Create Or Edit Htaccess File In cPanel?
Also Read: How To Force SSL Using .htaccess File?
Also Read: What is cPanel?
Also Read: Most Popular Control Panels.

Book A Call

This article helpful?
YesNo
Default image
Host Guid
Articles: 35

Leave a Reply

Open chat
1
Hii, How can I help you?