Www alias giving invalid cert error


I used sudo certbot --apache -d mysite.com on ubuntu / apache / Digital Ocean (1 click WP) to get cert and all works fine. Everything(www and non ssl alias) gets redirected to https://mysite.com But at that time I forgot to include www.mysite.com as well. As a result some of the users cant access https://www.mysite.com, as instead of redirecting it shows invalid cert error. Now I understand this can be fixed if I add a certificate for www alias as well but I am not sure how to go about it, Can I just add the certificate using certbot or need to remove the existing cert first. Pls guide with steps,


1 Like

Hi @sunny9616,

You can reissue an expanded certificate with

certbot --apache -d mysite.com -d www.mysite.com

Note that Certbot will be confused about this unless you have the ServerAlias entry in your VirtualHost showing that www.mysite.com is an alias for the same virtual host as mysite.com. When the ServerAlias is present, Certbot will offer to replace your certificate with an expanded one covering both names.


Hi Schoen, It worked fine, thanks for your help

Much Appreciated!!

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.