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?
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.
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.
@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.