is the certificate generated from this can be used for both www and non-www?
This normally will “work”
DocumentRoot /home/domain/public_html <Directory "/home/domain/public_html"> Require all granted </Directory>
I run certbot --apache -d www.domain.com
type the domain in the browser and if the domain is typed without www in it it will redirect to an url that has a www in it, but if you remove www after it loads and enter I got an error saying that the website is not secure . . . if I tried to generate a cert for the domain without www in it
certbot --apache -d domain.com
and do the same thing, open a browser type in www.domain.com, it will show an error saying that the website is not secure and a url that has no www in it just type domain.com will load without a problem.
the rewrite condition is set by certbot automatically, So I didn’t touch those.
I disable ssl on this domain that I used this, because of this issue.