Redirect traffic based on geo location of a US state

We have a site managed by Cloudflare and we are looking to see if we can redirect traffic to this site to a different site (outside Cloudflare) if the traffic is coming from a particular US state.

E.g. say our site is abc.com, if traffic is from California redirect to xyc.com. If traffic is from any other state or country do nothing, stay on abc.com.

Is that possible using Cloudflare and if so how?

Yep. ip.src.region_code will return state codes. You can paste this in the Expression Editor:

(ip.src.region_code eq "CA")

With that, you can redirect California visitors elsewhere.

1 Like

Great thank you!

2 Likes

Great! How/where does one put this information to use?

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