SSL for HTTPS and www

Hi Everyone,
Can anyone explain in a simple way how to generate a ssl certyficate for all cases:

I use such a command:
certbot certonly -a manual -d --preferred-challenges http

.htaccess file contain a code
RewriteEngine on
RewriteCond %{HTTP_HOST} ^www.
RewriteCond %{HTTPS}s ^on(s)|off
RewriteCond http%1://%{HTTP_HOST} ^(https?://)(www.)?(.+)$
RewriteRule ^ %1%3%{REQUEST_URI} [R=301,L]

I am a beginner, so please be understanding.

Please fill out the fields below so we can help you better. Note: you must provide your domain name to get help. Domain names for issued certificates are all made public in Certificate Transparency logs (e.g., so withholding your domain name here does not increase secrecy, but only makes it harder for us to provide help.

My domain is:

I ran this command: certbot certonly -a manual -d --preferred-challenges http

It produced this output:

My web server is (include version):

The operating system my web server runs on is (include version):

My hosting provider, if applicable, is:

I can login to a root shell on my machine (yes or no, or I don't know):

I'm using a control panel to manage my site (no, or provide the name and version of the control panel):

The version of my client is (e.g. output of certbot --version or certbot-auto --version if you're using Certbot):


The certificate you got on 2022-09-21 Common Name is also the Matching Identities is the same. You want Matching Identities to contain both and
See |

Matching Identities is also know as Alternative names and Subject Alternative Name (SAN)


In the simplest of words, just add both names to the single request:

certbot certonly -a manual -d -d --preferred-challenges http