Problems redirecting to a custom subdomain for a 'deploy' branch
I have a feeling this is futile, but this is what I'd like to do:
GOAL
- I have a branch with an alias for a very small Remix project (basic Web site).
- I have this branch locked down via the initial Zero Trust policy — I have to get an email with a pin to access the branch deployment.
- I'd like to put a redirect a subdomain from my custom domain to it.
- For instance, I want to point staging.my-domain.ai to alias-name.repo-name.pages.dev
- I also want to add two names to my Zero Trust policy to allow them to access this staging branch with a pin, too.
CURRENT STATUS
- The DNS records are managed by a domain registrar. I'd rather not transfer — it'll be a pain in the neck.
- I already have Cloudflare serving the production branch to the custom domain (I've configured CName records, as per directions).
- I then made a new CName record with "staging" as my host and as the value.
- I set up a custom domain in Cloudflare, ran the DNS check, and eventually saw the dashboard report the name active.
But, wah-wah...
I think Cloudflare is redirecting to the production branch. There's a note in the docs suggesting this may happen, but I'm learning as I go and that note wasn't totally clear to me until I gave it all a whirl.
HELP?
Is there any way to make this work without transferring the DNS to Cloudflare?
If I were just starting this part of the project, that'd be fine with me, but, given that this part is set up and development is still a work in progress, I'm not ready to make a more drastic change on this front.
Are there any other recommendations of an approach to try?
2 Replies