How to do Hotlink Protection in wordpress at Cloudways?


#1

Currently i am using digital ocean server. I want to enable hotlink protection in my wordpress website.

i have already tried via .htaccess file using http_referrer method but its not worked.

Can anyone here help, how to do hotlink protection for images?


#2

Posssibly this security plugin will work for you, it has hotlink protection as an option:

All In One WP Security & Firewall


#3

Most direct method is to block hotlinking using the htaccess file. Here’s an excellent tool for generating the correct htaccess code.
http://www.htaccesstools.com/hotlink-protection/

Hope that helps?

Paul


#4

i have already tried via .htaccess file using http_referrer method but its not worked.

Because Apache + Ngnix server configuration at cloudways.

  1. .htaccess is for Dynamic request.

  2. Nginx config file is for Static request.

So need to edit nginx config file for hotlink protection.

After discuss with their support team. you can only not allow to edit nginx file.

Is there any one who has setup hotlink protection for wordpress site with .htaccess?


#5

Another option, if you use Cloudflare, is to just check their one-click hotlink protection service.


#6

Thank you for you reply.

If i am using cloudflare then google images block my images also. There is no option available for domain white list (like google, pinterest, twitter) at cloudflare.