Redirection Isn't Working: How to Redirect Traffic Based on Country with Cloudflare

Hi, we need to forward/redirect all traffic outside of the UAE to another site. However, I am not seeing any option to redirect the URL.

I mean, when people from the UAE visit, they will use If anyone from other countries outside the UAE visits, they will be forwarded/redirected to

How can we achieve this using Cloudflare?


You can adapt from the example here: Single Redirects โ€” Example rules ยท Cloudflare Rules docs

Your filter expression could be:

ip.geoip.contry ne "AE"

But perhaps you should exclude redirection for SEO, marketing and other paths. ne "AE" and not in {"/ads.txt" "sitemap.xml" etc.}

Then you can set your target URL either as:


if you want all visitors to land at the homepage of the target domain, or

concat("", http.request.uri.path)

if you want visitors to land at the requested path, but in the target domain.

1 Like