How to block all referrer with a particular TLD?

I would want to block all referrers that have a particular TLD, let’s say “.abc”. So, I would want to block the domain “”, but not “”.

If I make a Cloudflare rule like:
(http.referer contains “.abc”) then block

Will the rule block referrer like “” also or will it block only referrers that have TLD “.abc” ?

Yes, it will block more, also the example you provided. Your best bet might be

http.referer contains ".abc/"

However even this might block

Currently there is no clean solution to do this, unless you upgrade to a business plan in which case you can use regular expressions. An alternative might be Workers and custom code, however that could be pricey as you’d have to tunnel each request through them.

Thanks for the reply.

This topic was automatically closed after 30 days. New replies are no longer allowed.