SSL certificate to include the new branch sub-domain for develop

Hi! I’ve followed this post on how to setup a custom domain for a branch deploy: [Support Guide] How to use Netlify’s branch deploy feature without Netlify DNS

Could you please extended the SSL cert to cover canonical name =

Thank you!

Hi, @FlorianWerndl, would you please first delete the inactive DNS zone here?

There is more information about why that should be deleted here:

There is a second issue. The primary custom domain for this site is and not Because of this the branch subdomain must be and not

To resolve this second issue, either make the CNAME record for or make the primary custom domain for the site (under Site Name > Settings > Domain management > Custom domains).

If there are any questions about this, please let us know.

Hi @luke,

thanks for your help. I deleted the DNS Zone and changed the primary domain.

Hi, @FlorianWerndl, I’m showing the SS certificate does now include and that this custom domain does serve the branch version of the site.

If there are other questions or concerns, please let us know.

Hi @luke,

I cannot see my develop branch being deployed to ( Am I doing something wrong? I am using

netlify deploy --alias develop --site $NETLIFY_SITE_ID --auth $NETLIFY_AUTH_TOKEN --message "";

for deployment via gitlab ci

Thank you

Hi, @FlorianWerndl. I believe the issue here is because there was already an existing branch for the alias when it was used. This is the deploy being shown for that URL:

I believe this is the last time a deploy for that branch was done using a build at Netlify.

Because there is an existing branch deploy with this name, using the same name for the --alias option isn’t working (at least that is what seems to be happening).

Would you be willing to test a netlify-cli deploy with the --alias option set to “testing” (or “potato”)?

​If so, please let us know when that is done as I’ll want to see if the alias subdomain is successfully directing to that deploy or not.

EDIT: The “potato” --alias was because I was also working on this topic and there the other person troubleshooting is using “potato” for a testing string. I’m mentioning this because it is otherwise very random and I didn’t want you to wonder why I had said that. It would have made more sense if I included that the other (“other” meaning the “correct”) topic. :slight_smile:

Hi @luke,

using --alias potato works like a charm (

Anyway I can get --alias develop get working? Otherwise I just change my cname record to point to a new, maybe the potato, alias :wink: - which would be fine as well.

Thanks for your help!

Hi, @FlorianWerndl. This is somewhat uncharted territory for me. I’m not sure is the subdomain alias being added works like a “real” branch subdomain.

If it does work, the only way to remove the branch subdomain would be to delete the site and recreate it. I don’t know if you want to go that far with this site and, if not, we might just skip the test below.

Personally, I am curious but I’ll leave the decision to you about wether or not to test further.

So what do we know so far? We know that using the --alias which is identical to a previously used “proper” branch subdomain doesn’t work and the “proper” branch takes precedence in that scenario.
(When I say “proper” branch subdomain, I mean that the deploy itself was part of a site build at Netlify where that specific branch was being deployed as opposed to the production branch.)

Does it work if there isn’t a collision with an existing branch subdomain?

We could test it though and then we would know for sure. If you want to help me test, would you be willing to please do the two following things?

  • make a new deploy (a second one) using the same --alias potato option
  • create a CNAME record for pointing to

Please reply once that is done and I’ll be able to confirm if this works like “proper branch subdomain” because there is no existing branch named “potato”.

Once we know if it works or not we can discuss possible workflows with that in mind. Again, if you don’t feel like testing is worth it or simply don’t have the time to do so, please let us know and I’ll try to find time to do the testing.

Hi @luke

thank you for investigating into this.

I’ve deployed again with --alias potato and I can see the changes on

I’ve also created a CNAME record:


Non-authoritative answer:	canonical name =

Hi, @FlorianWerndl, thank you for making the new deploy and the CNAME record. This did allow me to test the is these --alias subdomain strings can be used in the same way branch subdomains work.

Unfortunately, however, my testing of this confirms the subdomains set using --alias option do not behave like branch subdomains. Even if I extend the SSL certificate to include this isn’t working like a normal branch subdomain. I get a 404 instead of getting the branch in question.

I can enter a feature request to ask them to work the same way but I cannot make any promises of if/when that feature might become available.

Do you want me to enter this as a feature request?

Either way, we are also happy to look for other solutions for this. For example, you might deploy these each to a unique site and that would allow you to set the domain name directly on the site itself.

In other words, a workaround might be to use completely different sites instead of using --alias for a single site. The subdomain used would just be the official subdomain for the site itself.

If there are other questions or if we should file the feature request for this, please reply anytime.

I actually found an open feature request and cross-linked this topic to it. If/when it is possible to use the branch subdomain features with manual deploys we will post an update here to let you know.

Thank you for the effort on this one @luke!