How to set domain for preview branch?

I can't find the options to set preview domain to preview.<myapp>.pages.dev
6 Replies
Hello, I’m Allie!
?custom-branch-domain
Flare
Flare17mo ago
To use custom branches with a custom domain on Pages, follow this guide: https://developers.cloudflare.com/pages/how-to/custom-branch-aliases/
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.
chientrm
chientrmOP17mo ago
I mean, I don't have that preview.<myapp>.pages.dev it is a hash: https://af841782.shitpostai.pages.dev
Chaika
Chaika17mo ago
it would be whatever branch name af841782 is on
chientrm
chientrmOP17mo ago
oh, it is
Chaika
Chaika17mo ago
When a preview deployment is published, it is given a unique, hash-based address — for example, <hash>.<project>.pages.dev. These are atomic and may always be visited in the future. However, Pages also creates an alias for git branch’s name and updates it so that the alias always maps to the latest commit of that branch. For example, if you push changes to a development branch (which is not associated with your Production environment), then Pages will deploy to abc123.<project>.pages.dev and alias development.<project>.pages.dev to it. Later, you may push new work to the development branch, which creates the xyz456.<project>.pages.dev deployment. At this point, the development.<project>.pages.dev alias points to the xyz456 deployment, but abc123.<project>.pages.dev remains accessible directly. Branch name aliases are lowercased and non-alphanumeric characters are replaced with a hyphen — for example, the fix/api branch creates the fix-api.<project>.pages.dev alias. To view branch aliases within your Pages project, select View build for any preview deployment. Deployment details will display all aliases associated with that deployment.
https://developers.cloudflare.com/pages/platform/preview-deployments/
Want results from more Discord servers?
Add your server