Create a redirection from one subdomain to other

I want to redirect all traffic from multiple (60+) subdomains to one URL. I don’t want to buy 60+ page rules so I decided to create just one page rule for one subdomain and redirect all other subdomains to the subdomain with rule.

So let’s assume that we have It’s redirected to via page rule.

Now I want to connect all other subdomains (, to the How can I do that?

How this setup looks like now:
CNAME points to (literally, I’m not hiding it). This subdomain also has a page rule that redirects all the traffic to
CNAME points to

All domain entries are proxied. Also account has a SSL mode “Full (strict)”.

Now when I’m trying to get I’m getting a 526 error (Invalid SSL certificate). How can I fix it? May I create a direct DNS record to redirect users from to instead of using page rule?

Thank you in advance!

You can do this via a worker or by creating a page rule

See for more info on create a worker redirect

See on creating a page rule (without creating a worker)

CNAME really isn’t going to cut it. But since they’re all there and :orange:, then that’s a good start.
This should work with just two page rules, assuming the only other “subdomain” you have is ‘www’.

Rule #1: Match* with a Setting of Cache Level “standard” (or some other setting that doesn’t change how the site already works. This is a place holder rule so Rule #2 doesn’t trigger for the ‘www’ subdomain.
Rule #2: Match ** with a Setting for Forwarding URL to your destination.


Thank you for your help! I really appreciate that! Unfortunately options you suggested don’t fit my needs since I need to create those rules on-the-fly. That means I’ll have one rule per subdomain (60+ rules) or I’ll have to modify the worker code after adding each subdomain which is also inconvenient.

BTW, thank you for your help!

Thank you a lot! I’ll try to implement your suggestions on my project tomorrow. I’ll let you know if it would be successful. Thank you again!

1 Like

Unfortunately, that option will not fit my needs. I would consider other services like Easyredir. Thank you for your time and your help!

1 Like

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