We have a zone that uses the Business plan. It is configured using CNAME setup (so cloudflare isn’t the dns server of our domain - each subdomain we want to use/benefit from cloudflare has a CNAME value of SUBDOMAIN.domain.com.cdn.cloudflare.net).
Currently our www.domain.com subdomain is a CNAME to www.domain.com.cdn.cloudflare.net, and in cloudflare www.domain.com (orange cloud) points to our current server, let’s call it server.domain.com.
As we work on migrating our static website to Cloudflare Pages, we want to do it in a controlled manner so we could both test everything’s working as should AND do a/b tests on the conversions of trialers.
To achieve this, we wanted to do 2 things:
Connect a staging environment subdomain to a branch deployment of a preview environment
This doesn’t work (at least for our CNAME dns setup). I created a new route53 cname record pointing our staging.domain.com to staging-branch.ourwebsite.pages.dev but going to staging.domain.com returned the production deployment of the cloudflare pages app.
Use the weighted DNS records of Route53 to have a percentage of the traffic receive the cloudflare pages website and the rest receive our old website. So let’s say 50% of dns queries will resolve www.domain.com as a cname to www.domain.com.cdn.cloudflare.net and the other 50% will resolve to ourwebsite.pages.dev.
This doesn’t seem to work as well as to get www.domain.com render the cloudflare pages app, I need to add it as a custom domain for the pages app, but when I tried doing that I got the warning that it would change the cloudflare dns record for www.domain.com from server.domain.com to ourwebsite.pages.dev.
This means the percentage that even the 50% that will get the cname of www.domain.com.cdn.cloudflare.net will also get the cloudflare pages website and not the old website.
Any ideas of how can this be done?