Redirecting All traffic to Another Domain

Hello guys. I have two domains. One is and the other one is

Now what I want to do is redirect all domain and subdomain queries of to what I mean by that is every time you input* or* you will be redirected to*. Now since Cloudflare has something called page rules I wanted to use it to achieve my desired output. Here are the DNS records and page rules that I set up. Note that I set up rule 1 & rule 2 because rule 3 didn’t work.

Now my theory behind this was simple. If Cloudflare DNS have the authorotity (or DNS records) over my domains and subdomains than it should be possible to redirect every domain and subdomain queries to another domain with Page Rules. Cause such queries are to be proxied through Cloudflare servers!

Now even though my queries are bring redirected to somehow, for some reason and are not working. And I actually don’t have much idea how CNAME records work. I just inputted two cname records so that Cloudflare knows that those domains exist and try to automatically proxy them and I can use the Page Rules.

It would be great if someone told me how CNAME * > is working and what should I do to achieve the result I wanted.

I just wonder, doesn’t the free cf and tk domains have forwarding at their interface? Do you need to do it via Cloudfalre?

Also, I see * (asterix) record and you are using a CNAME.

Moreover, maybe the below articles could help you with non-www to www, from one domain to another?:

1 Like

Ok I did the following…

A @ proxy
A www proxy

and in page rules,

** >$2

And it works as intended.

But I cannot understand why subdomains are not being redirected without the CNAME record.

1 Like

@fritex do you know why subdomains are not working without the CNAME record?

Try modifying one of the page rules, you may have incorrectly configured it to redirect (likely to the wrong page)

@AppleSlayer it works. I just want to know why I need this CNAME record.

Because the DNS record has to exist for page rules to trigger on it

Yes but it won’t work if I put in I have to put in or other domains. How it works actually.

Maybe using a page rule **? (see the * then dot to catch www, sub1, sub2 …)?

You can use A records rather than CNAME, but in that case you would need to know the host/origin IP address where the website/content is located.

You cannot have the same multiple records for your domain because you already have CNAME record from the above screenshot. Moreover, you cannot add domainC, domainD, domainE to your DNS records of domainA.

Add a new record CNAME subdomain and point it to, then use the suggested Page Rule to catch the needed.

  • or maybe you want to achieve a redirection from subdomain.domainA.tldA/* to subdomain.domainB.tldB/*?

The page rule in the following post is the only page rule I currently have.

Tried a dummy A record. But cf won’t proxy wildcards for free accounts. So, it didn’t work. Maybe I should do and use the ips for the proxy?

I know. What I mean’t by that is I tried to add a record CNAME * > but it didn’t work. Then again I tried CNAME * > and it worked for some reason. I wan’t to know what the reason is.