Doesn't redirect from non-www to www

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

I ran this command:

It produced this output:

My web server is (include version): LAMP

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

My hosting provider, if applicable, is: Digital Ocean

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

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): certbot 0.40.0


I have followed the digitalocean instructions to install SSL but my domain doesn't redirect from non-www to www version and I am getting this warning from Kaspersky.


and this is my redirection result.

Hostname/IP does not match certificate's altnames: Host: is not in the cert's altnames:

Can you please help me?

1 Like

Hi @tolgacan

please read your error message.

Your certificate has only the www version, not the non-www version. So the non-www version is insecure - and the result is expected.

-> Create one certificate with both domain names.


I am sorry bro but I am complete newbie.
As far as I know when setting up ssl certificate through DigitalOcean, it asked me to type my domain name without http and at the end of the setup it asked me to redirect or not and I chose 2nd one for new sites.

Can you please elaborate what I should do in this stage?

thank you so much

1 Like

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