How to geoblock certain US states

Hi Cloudflare community,

Due to the content on my community, I need to geoblock certain US states (such as Utah, Louisiana, and Florida). Ideally, I’d like for each state’s users to be routed to a custom page per state such as Utah visitors seeing an explanatory page on mywebsite.com is available for purchase - Sedo.com. I am on the Cloudflare business plan.

Can anyone provide instructions on how to achieve this?

On a personal note, I am not techie at all but I am exceedingly good at following step by step instructions. I would appreciate instructions that are straightforward and specific - thanks in advance.

Joel

You can get US states from the ip.src.region_code field. In the WAF use the raw expression editor.

3 Likes

You could probably combine that with an in operator and a list of the state region codes, but I haven’t ever attempted it myself.

{ip.src.region_code in {"FL" "LA" "UT"}}

2 Likes

Thank you everyone, I was able to setup the geoblock.

Yes, you can identify several states all at once with the in operator

1 Like

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