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 develop.bausatzbuch.de

develop.bausatzbuch.de canonical name = develop--bausatzbuch.netlify.com.
Name: develop--bausatzbuch.netlify.com
Address: 142.93.108.123

Thank you!

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

https://app.netlify.com/account/dns/bausatzbuch.de

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

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

To resolve this second issue, either make the CNAME record for develop.www.bausatzbuch.de or make bausatzbuch.de 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 develop.bausatzbuch.de 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 https://develop--bausatzbuch.netlify.app/ (develop.bausatzbuch.de). Am I doing something wrong? I am using

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

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 (https://potato--bausatzbuch.netlify.app/).

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 potato.bausatzbuch.de pointing to potato--bausatzbuch.netlify.app

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 https://potato--bausatzbuch.netlify.app/

I’ve also created a CNAME record:

nslookup potato.bausatzbuch.de
Server:		1.1.1.1
Address:	1.1.1.1#53

Non-authoritative answer:
potato.bausatzbuch.de	canonical name = potato--bausatzbuch.netlify.app.
Name:	potato--bausatzbuch.netlify.app
Address: 157.230.103.136
Name:	potato--bausatzbuch.netlify.app
Address: 167.99.129.42

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 potato.bausatzbuch.de 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!

2 Likes