Redirect of domain and subdomain

Hi
I get 2 domains, one old and one newer.
I want to redirect all requests of the old domain to the newer
But I get subdomains and URL.
So I set URL to *example.org/*
and the destination to https://$1example.com/$2
because I have domain like that: https://sub1.sub2.example.org/path witch need to become https://sub1.sub2.example.com/path
Twice domain are set in cloudflare and twice have a server
How I can process?
Thanks

(Sorry for my bad English)

First you’ll need to look at Advanced certificate manager as the default Cloudlfare certificate with Universal SSL will only cover one level of subdomain (example.com and *.example.com).

Then look at redirect rules.

If sub1 and sub2 are just a few values, you can do something simple like this…

If sub1 and sub2 are lots of values, then you’ll need to code up some string manipulations to do what you want…

…or bulk redirects…

2 Likes

Thanks
Can I set a rule like *example.org/* to $1example.com/$2 and it will work because it’s wildcard?
because I have set the record * to point to one ip and all subdomain and sub.subdomain work also

And if I use Cloudflare proxy, it will get CIPHER_ERROR_SSL with sub.subdomain
Do you have a solution?
Thanks

As mentioned, by default Cloudflare issues a certificate only for one level of subdomain. You need to use Advanced Certificate Manager for second level and deeper.

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