Enable HTTPS on www. as well as without

Hi

I set up my blog without www. (domain.com) in the domain name.
I’ve now added a CNAME so it directs to www.domain.com if needed but I need to edit the SSL certificate to also work for the www. version.

Running my blog on DigitalOcean, what’s the best way to do this?

Thanks!

See “SSL for additional domains” in the CLI knowledgebase here:

2 Likes

Why does the installation of Ghost not automatically set the SSL for the www and non-www domain with the right redirect? I’ve always wondered.

It would involve making a bunch of assumptions because determining what’s an apex domain is tricky. You could check to see if the WWW has the same A record but that seems like a lot of work and a lot of code to maintain and only solves it if people remember to point both domains in the first place, which they often don’t.

What we really want is a single command to add extra SSL certs and redirects, which is spec’d here: https://github.com/TryGhost/Ghost-CLI/issues/224, but as you can see by the date, it’s just not something anyone really cares about.

I understand what you say.
But I personally think that a lot of people are not yet aware of having only one domain configured.
They are not aware that if they try to connect to www or non-www (based on what they configured during installation) the site will have certificate problems and will be unsafe.

1 Like

@giacomosilli As I said don’t think there’s a sensible way to implement what you’re saying, but if you think there is then by all means have a go - this is OSS after all.

1 Like