My certificate will not innclude www

My certificate cannot secure the WWW only non-WWW. After a lot of research I have accepted I am not able to fix this myself and need help.

My domain is: aajs.com, and I normally keep the .htaccess with
RewriteCond %{HTTP_HOST} ^aajs.com [NC]
RewriteRule ^(.*)$ "https://www.aajs.com/$1 [L,R=301]"

For now I have excluded it to show the web page with the working SSL.

I ran this command: '.acme.sh/acme.sh --issue -d aajs.com -w /home/xensicom/aajs.'

It produces this output: certificate for aajs.com not including 'www.aajs.com'.

However, I have 3 subdomains xxxx.aajs.com and the certificates for all of these also valid for www.xxxx.aajs.com?

The operating system my web server runs on is some Linux with kernel vesion 4.18.0-553.lve.el8.x86_64

My hosting provider is:Namecheap

I can't login to a root shell on my machine.

I'm using cPanel with terminal

Not possible to use Certbot with Namecheap. What about using CertSage and will it be creating www and non-www? I cannot test this as I am over the rate-limits until tomorrow.

When you request a certificate you specify the domains or subdomains you want to include on them.

From the acme.sh github page you would request your cert like so with as many domains as you want to include for this sites certificate:

acme.sh --issue -d aajs.com -d www.aajs.com -w /home/xensicom/aajs

A certificate only covers the names included on that certificate, unless it's a wildcard (e.g. *.aajs.com) in which case it can cover the first level of subdomains under that name.

Based on crt.sh | aajs.com you seem to managing this ok for your other subdomains.

4 Likes

What I have done gives me 2 separate certificates with no help for me except for in ZeroSSL.

Earlier I had no problems until I got it in to Namecheap and my free period with their certificate expired. I like Let's Encrypt since I can have more sub domains.

Yes, my other domains works because I have only renewed them and that works for me.

Will your acme.sh --issue -d aajs.com -d www.aajs.com -w /home/xensicom/aajs make one certificate or two separate?

A single command invocation creates a single certificate. See Example 2

5 Likes

Just followed your suggestion and it worked like a dream. Problems solved, thanks to you being helpfull :sun_with_face:

3 Likes