Firewall rules for specific URL

Hi,

I’m looking to block/use captcha challenge for users from a specific country which I suspect are non-humans. From my analysis, these bots are visiting specific URLs of my site. Is there a rule which can fire captcha only for those visiting that particular page (or pages)? Thanks.

Sure, https://developers.cloudflare.com/firewall/cf-firewall-rules/fields-and-expressions/ has all on that.

Plus https://developers.cloudflare.com/firewall/cf-firewall-language

Thank you so much. I’m not a developer and new to this. Can you please help me with the actual parameter for the landing page. The URI points to the referrer right? And not the landing page.

No, the referrer has its own field. The URI is what is actually requested. You need to use that, just check out the documentation as it covers that all, particularly the second link.

The firewall rules UI actually guides you through that too.

1 Like

I want to restrict traffic only for my homepage. Using “URI path = /” doesn’t work unfortunately since it blocks traffic to ANY page. What’s the best way to handle this?

You said you wanted to block a specific path of your domain, right? Possibly combined with a limit on countries. What’s not clear as far as the documentation is concerned? You don’t even need to write the expression manually in this case, the UI should do it for you.

Really appreciate your patience here. I want to block access ONLY to the homepage of my site to visitors from specific countries. Currently, it’s blocking access to ALL pages for these visitors. Attaching my current rule.

Currently you block the Emirates when visiting the root page and all of Germany regardless of what they visit.

Drop the two country rules and just add one single country rule with an is in expression.

2 Likes

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