Adding Alias to Preview Deployments

How can I set one permanent URL for the preview environments like staging and development?

If you want to reach them using the pages.dev subdomain just add the branch name as a subdomain to your main subdomain.

If you want to use a custom domain for the same purpose, just add it as normal and then change the CNAME target to the subdomain as above.

2 Likes

Added as ..pages.dev as CNAME Value and it’s working.

You haven’t added it as a custom domain to Pages itself, haven’t you? :wink:

I could have been more explicit, but add the custom domain as normal and then modify the CNAME target.

Hi Matteo,

I’ve done that, also. After that, I manually changed the DNS record to point preview env.

Then it should work.

Two ideas, the site are for some reason identical (does the direct pages.dev url show the correct content you expect?) or caching is enabled for some reason and/or it didn’t purge.

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.