I would like to redirect xxx.xxx.com to xxx.xxxx.eu

i would like to redirect xxx.xxx.com to xxx.xxxx.eu for all EU region traffic how should i config in cloudflare ?

You can use a redirect rule, but you’ll have to use the Expression Editor to use the EU check if you’re on a Business Plan:

(http.host eq "example.com" and ip.src.is_in_european_union)

Otherwise, just use the Expression Builder for hostname and continent.

Hi , not in Biz plan but i try host name and continent is not working any advise ?

  1. Make sure there’s a DNS A or AAAA record for the hostname you’re trying to redirect. Since this is only a redirect, you can use an A record with a dummy IP address like 192.0.2.1.
  1. Make sure this hostname is Proxied (:orange:).

If you’ve done these and the redirect is still not working, show us a screenshot of your redirect rule. The hostname you’re redirecting should be visible in the screenshot so we can look it up.

1 Like

Hi , i not trying to redirect globally for the hostname just EU region so in this case still need to setup dummy ip address in A record ?

1 Like

The use of the dummy IP is just for hostnames that don’t have a real server, so assuming that you want non-EU traffic to reach a server that hosts the com. site and it already has an entry, you won’t need any placeholder records.

1 Like


this is my current setting which not working

You left most of your fields blank.

Try something like this:

And if you run a global check, you’ll see that European users get the redirect:

1 Like


it still not working any other possible setting causing it ?

That hostname is not proxied by Cloudflare:

> GET / HTTP/2
> Host: lirunex.com
> User-Agent: curl/8.4.0
> Accept: */*
> 
< HTTP/2 200 
< server: nginx
< date: Thu, 16 May 2024 03:56:03 GMT
< content-type: text/html; charset=UTF-8
< vary: Accept-Encoding
< x-cache-enabled: True

If it was, “server” would be “cloudflare”, and you’d see several cf- headers.

Either your DNS record for that hostname is not :orange: Proxied (:grey: DNS Only instead), or you’ve Paused your site on Cloudflare.

1 Like


ok it success redirect but how come the url become like this during redirection ?

Good question. I failed to catch that your redirect target does not have a scheme (https://).

Because that’s missing, it treats the redirect like a path under the same hostname.

1 Like

so for this have no solution ?

Just add this:

1 Like

thank you very much the issue has been resolve

2 Likes

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