How to redirect (via Redirect rules) www subdomain to some external URL?

What is the name of the domain?

What is the error number?

None

What is the error message?

None

What is the issue you’re encountering

Unable to redirect www subdomain to an external website

What steps have you taken to resolve the issue?

Hello,

I’ve registered a domain via Cloudflare.
And I’ve created two ‘A’ DNS records where ‘domain.org’ and ‘www’ points to 192.0.2.1 and are proxied.
I’ve also create this redirect rule (http.host eq “pierre-ia.org”) that redirect to an external website → it works like a charm.

However, and whatever I try, I’m not able to redirect my www subdomain to the same external website.
What redirect rule do I need to create?
I might be missing something obvious.

Thanks for your help and guidance.

Greetings,

Thank you for asking.

You could combine both into one, or separate and have two.

Since the first Redirect Rule is working as http.host eq pierre-ia.org, put OR http.host eq www.pierre-ia.org.

Otherwise, if you’d use contains instead of equals in your current Redirect Rule, it would match even the other sub-domains like test.pierre-ia.org (if they do exist and are also pointed to e.g. 192.0.2.1 and proxied :orange: ) and not just www.pierre-ia.org and pierre-ia.org.

Helpful tutorial and example:

2 Likes

@fritex Thanks, the first works but I had to add a proxied CNAME record where www forward do domain.org.
Finally it works! Thanks again.

1 Like

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