Generating a cert for a non-www to an existing www

I am new to the cert world and afraid I might break something…
I need to generate a cert for a non-www domain for an existing www domain.

I generated a cert using this certbot certonly --webroot -w /var/www/html/mydomain/ -d mydomain.co.za , however because there was already a cert for the www.mydomain.co.za now two folder www.mydomain.co.za and mydomain.co.za are created,

WHat is the best way to create a cert for the non-www domain as this didnt help, I was still getting a not trusted site on my browsers and browsers are telling me the cert is only valid for the www.mydomian.co.za

Hi @emmanuel.mdaka

create one certificate with two domain names: Two -d flags, one with your non-www, one with your www domain name.

Thank you JuergenAuer for your rapid response…WOW!!

Like this correct? certbot certonly --webroot -w /var/www/html/atdws_live/ -d mydomain.co.za -d www.mydomain.co.za
Will this not affect the current cert that the server already issued www.mydomain.co.za

Thank you…it worked.
I used a dry run command as well to see how that goes first

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