How can I add a DNS record (dev.*) that points to a preview deployment?

I have a preview deployment with this URL: dev.[site-name].pages.dev, so I tried adding a CNAME record dev that points to dev.[site-name].pages.dev but navigating to it gives a 522, why's that? the pages.dev url works just fine
13 Replies
Chaika
Chaika4mo ago
need to add it as a pages custom domain under the Pages Project -> Custom Domains tab, then you can change the target to use the dev branch
Chaika
Chaika4mo ago
Cloudflare Docs
Add a custom domain to a branch | Cloudflare Pages docs
In this guide, you will learn how to add a custom domain (staging.example.com) that will point to a specific branch (staging) on your Pages project.
veeque
veequeOP4mo ago
yup that works, thank you! how do i mark this thread as solved?
Chaika
Chaika4mo ago
You can edit the tags, I already did it though
No description
veeque
veequeOP4mo ago
oh ok, thanks!
veeque
veequeOP4mo ago
ok so apparently now when i go there and i pass the login, i get a 404?
No description
veeque
veequeOP4mo ago
No description
veeque
veequeOP4mo ago
(ignore the passkeys.js, it's keepassxc)
Chaika
Chaika4mo ago
you have an access policy on it?
veeque
veequeOP4mo ago
if by that you mean the thing where i set which emails are allowed in, yes. otherwise i don't know what you're refering to
veeque
veequeOP4mo ago
is this what you mean?
No description
Chaika
Chaika4mo ago
yea, you'd need to add your dev custom domain as another part of that policy or remove it
veeque
veequeOP4mo ago
oh i see, trying it now ok, everything works! thanks!
Want results from more Discord servers?
Add your server