How to set domain for preview branch?
I can't find the options to set preview domain to
preview.<myapp>.pages.dev
6 Replies
?custom-branch-domain
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.
I mean, I don't have that
preview.<myapp>.pages.dev
it is a hash: https://af841782.shitpostai.pages.dev
it would be whatever branch name af841782 is on
oh, it is
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/