Custom subdomain for branch deploy

By default, when branch deploy is enabled, the subdomain used is [branch].[production domain]. For example, if my production branch is production and it is deployed to apps.example.com, then the master branch will be deployed to master.apps.example.com.

Is it possible for us to customize the subdomain used by non-production branches? For example, I might want to deploy master (which is an internal-ready branch) to staging.apps.example.com and rc to beta.apps.example.com.

hi there, give these articles a read through and see if any of this is helpful!

If not, please come back and let us know your instance name and what you have already tried, as well as any errors you see :slight_smile:

None of these addresses my issue. My instance name is vigorous-minsky-98a9dc.

Thanks for taking a look at those docs!

That is not currently possible - branch subdomains follow only the pattern BRANCHNAME.YOURCUSTOMDOMAIN. You can of course set up a separate site for any branch in your repo and name it whatever you want - so link to the ‘rc’ branch and call the site beta.apps.example.com . It is allowable and functional to link two Netlify sites to the same repo for purposes such as these.

Okie, thanks for the note! Any plans to add support to customize the branch subdomains (without creating a new site, that is)? :wink:

2 Likes

There is an open feature request, but that does not intend to imply that we have “plans to add support”, only that you and others have requested it. It does mean we’ll follow up in this thread if things change though :wink:

1 Like

@perry @fool Just checking in since it’s been a year since this feature was requested.

Any updates on supporting custom subdomains for branch deploys?

Some background on my use case:
My docs website which is hosted on Netlify uses a branch for each minor release, and we build them all into one site (https://github.com/projectcalico/calico). With 25 releases, we’re bumping into the 15 minute limit imposed by Netlify. We want to split them into smaller chunks using branch deploys, but our branch names all follow the pattern “release-vX.Y” so our URL’s would look unpleasant as https://release-v3-0.docs.projectcalico.org (for example). This branch naming convention is used across all 40 of our repositories so we’d need to rewrite a lot of our build machinery to support dropping the “release” on this repository. @fool 's suggestion of creating a separate site for each branch is not really feasible for us either as we have 25 releases and managing 25 netlify sites would be a burden.

Hi, @ozdanborne, the feature request is still open. If/when it becomes available we’ll post an update here to announce it.

My solution was to create a different Netlify site for every branch. Not that good, but… It works.

thanks for sharing your workaround,. not ideal, i know, but still a good solution for the time being.