Hotlinking of images

Hi, I am trying to prevent hotlinking of images from my websites, by making a Firewall Rules, but it needs to allow Search engines like google and yahoo to index my photos! By searching the web I haven’t found a Firewall Rules that are confirmed to work

I have come to this solution below. ( I am not a programmer; I can manage copy and paste)

(http.request.method eq “GET” and http.referer ne “.example.com” and not http.user_agent contains “(googlebot| cf.client.bot | yahoobot )” and http.request.uri.path eq “/ content / jpg /”)

Any help appreciated.

There is a dedicate hotlink switch, which will do exactly that.

https://dash.cloudflare.com/redirect?zone=content-protection

Thanks for your prompt reply,

What do you mean by that ?

Did you click the link and check out what it shows?

Yes, “Hotlink Protection-Protect your images from off-site linking”
But then my photos will not be indexed by Search engines like google and yahoo. if I have
got it right

I believe that wont apply to search engines, but you might want to double check this with support.

If you click on help that says: Hotlink protection has no impact on crawling, but it will prevent the images from being displayed on sites such as Google images, Pinterest, etc.

Of course it will, because you would be disabling hotlinking and that will naturally disable that too, because you disabled hotlinking.

I don’t have that hotlink switch on!!

I’m looking for a way so you can’t do hotlinking to my photos,
But still allow Search engines like google and yahoo to index my photos!

In that case you actually want hotlinking and hence cant disable it.

Your best bet would be a firewall rule of this type

image

1 Like

Thank you very much, I want to try it out and see what happens