I need some assistance/guidance for redirecting ~300 subdomains to a different subdomain, using page rules. I’ve read through the community and docs, can’t seem to find an answer…
I thought we had this figured out, and set up the dns records, and a wildcard redirect in page rules… but the behavior is not as intended. When the page rule is turned on, it breaks the root domain… We only want the subdomains to redirect.
We have DNS entry of each subdomain, with the orange cloud. For example: name.example.com. 1 IN A 64.246.164.131
The Page Rule that has been setup is to match the URL: https://*.example.com/ and Forward to: http://$1.agent.example.com/
Is there something different I should be doing for my URL match in the Page Rule? Is there another page rule I can add to prevent the root domain from being affected? Please help!
Awesome - thanks @cbrandt. We now have this sorted out and your advise was helpful.
I also needed on additional redirect to make all subdomains always use HTTPS because I needed to have the forwarding URL include HTTPS in the URL for Cloudflare to consider it a valid page rule.
So, my page rules are as such, which works!
URL: example.com/*
Forward to: https://www.example.com/$1
URL: www.example.com/*
Automatic HTTPs Rewrites: On
URL: *.example.com/*
Automatic HTTPs Rewrites: On
URL: https://*.example.com/*
Forward to: http://$1.subdomain.example.com/