Example.com works, but www.example.com not

i finally managed to make my page https, but the problem that i have now is, when i try to go ; www.example.com it gives the following error:

Firefox:
Your connection is not secure
error code: SSL_ERROR_BAD_CERT_DOMAIN

edge:
This site is not secure
Error Code: DLG_FLAGS_SEC_CERT_CN_INVALID

but; example.com works fine.

i am pretty new to this so i don’t really know much :frowning:

You need 2 certs for that. 1 for example.com and 1 for www.example.com.

i did
sudo nextcloud.enable-https lets-encrypt
for both, but still not working

Well my guess is you’re using the same cert for both domains. that’s not working unless you have a cert that fits that purpose. It seems letsencrypt supports this. https://letsencrypt.org/docs/faq/ Search for SAN.