Firewall rules - cannot block countries

Hi, I am trying to block every country except “US, UK, AU, NZ, CA” and this is my rule.
I currently live outside of those countries but somehow I can access my website just fine.
(*there was a moment it worked! and it actually blocked me. but a few seconds later it still not works…)

Your last statement says EQUAL for the US. That’s probably why it lets you in.


Thank you so much for your help. I mistakenly set EQUAL there… and now it’s “does not equal”.
However, I can still access my website. Currently I am using free trial version of Cloudflare. Would it be the reason?

Do you have “IP Geolocation” enabled under the “Network” tab?

1 Like

Thank you for checking! Yes. It’s already on.

I don’t think this is related to the OP’s issue. This option is used for server-side to extract the visitor’s country.

So, is the issue still persists?

If yes, check your firewall rules order, and try go to and see what’s your country code.

1 Like

In case you want to be sure, allow Cloudflare IPs on your network and add CF-connecting-IP to your web server configuration file.

1 Like

There’s always the chance you added your IP address to the Allow list in Firewall → Tools.

A good test is something like Free Website Speed and Performance Testing | Dotcom-Tools where you can set test locations.


Thank you Eric,

I have only one rule and there should not be any other rules interrupting the First Rule…
I have checked my country code with your method. Is there any action I need to take :)?

Thank you so much, everyone.
Your comments helped me understand the firewall system so much better.

It seems like it sometimes works and sometimes doesn’t. lol
It looks like it has blocked some access from China and bot access from Canada.!
Still not sure why this is happening, but I will keep my eye on it.
“Please let me know if you have other suggestions or advice.”

Thanks again :)!


I don’t believe that and is working in regex the way you would expect it to be. Try is not in or is in and add the countries to the list.

Is this a malfunction? Because I use AND for all kinds of rules with User Agent ‘contains’.

1 Like

He is not using regex.

But I do agree that this is a better way to add the list of countries.

He’s using the rules builder which generates regex from a simple and easy to use gui

1 Like

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.