How to block country from accessing website?

Hi, I had applied the Firewall rule to block a country from accessing my website, however, when I test it using browserstack.com, I still could see the website load in a different country. Please help.

Having a bunch of “AND” statements won’t work since ip.geoip.country can only be a single country at one time. You should use the “is in” operator instead.

1 Like

Thank you. What if I want to redirect the visitors from those blocked countries to another website? What rule should I put in?

The firewall only blocks or passes. It does not redirect. If you’re on a Paid Plan, you could use Firewall → Tools to block by Country, then create a Custom Error Page for Country Blocks.

https://support.cloudflare.com/hc/en-us/articles/200172706-Configuring-Custom-Pages-Error-and-Challenge-

Thank you, but the custom page could only be 1.4 MB in size. What if I want to redirect people from a geographic region to my facebook page?

The only way I can think of this working is with a Worker:

2 Likes

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