SSL works with www and not without www

I have migrated a wordpress website from siteground to Linode using Duplicator plugin. Website worked fine. When I tried to install SSL using Let's Encrypt and made changes to my wordpress settings to load it over, The website is only working over and does not want to work over
My domain is:
I ran this command:
sudo certbot --apache
It produced this output:
Saving debug log to /var/log/letsencrypt/letsencrypt.log

Which names would you like to activate HTTPS for?


Select the appropriate numbers separated by commas and/or spaces, or leave input
blank to select all options shown (Enter 'c' to cancel):
Requesting a certificate for and

Successfully received certificate.
Certificate is saved at: /etc/letsencrypt/live/
Key is saved at: /etc/letsencrypt/live/
This certificate expires on 2021-10-22.
These files will be updated when the certificate renews.
Certbot has set up a scheduled task to automatically renew this certificate in the background.

Deploying certificate
Successfully deployed certificate for to /etc/httpd/sites-available/
Successfully deployed certificate for to /etc/httpd/sites-available/
Congratulations! You have successfully enabled HTTPS on and

If you like Certbot, please consider supporting our work by:

My web server is (include version):
Server version: Apache/2.4.37 (centos)
Server built: May 20 2021 04:33:06

The operating system my web server runs on is (include version):
CentOS 8
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):
certbot 1.17.0

the output of sudo httpd -S:

VirtualHost configuration:
*:80 (/etc/httpd/sites-available/
*:443 is a NameVirtualHost
default server (/etc/httpd/conf.d/ssl.conf:40)
port 443 namevhost (/etc/httpd/conf.d/ssl.conf:40)
port 443 namevhost (/etc/httpd/sites-available/
port 443 namevhost (/etc/httpd/sites-available/
ServerRoot: "/etc/httpd"
Main DocumentRoot: "/var/www/html"
Main ErrorLog: "/etc/httpd/logs/error_log"
Mutex cache-socache: using_defaults
Mutex authdigest-opaque: using_defaults
Mutex watchdog-callback: using_defaults
Mutex proxy-balancer-shm: using_defaults
Mutex rewrite-map: using_defaults
Mutex ssl-stapling-refresh: using_defaults
Mutex authdigest-client: using_defaults
Mutex lua-ivm-shm: using_defaults
Mutex ssl-stapling: using_defaults
Mutex proxy: using_defaults
Mutex authn-socache: using_defaults
Mutex ssl-cache: using_defaults
Mutex default: dir="/etc/httpd/run/" mechanism=default
PidFile: "/etc/httpd/run/"
User: name="apache" id=48
Group: name="apache" id=48

1 Like

Have you tried restarting your server? Currently it's serving your default certificate self-singed by linode, not a Let's Encrypt certificate.

1 Like

Here's your problem: your main domain without www is also configured in ssl.conf, which is used over the virtualhost generated by Let's Encrypt.

Also, for some reason you seem to have requestes a new certificate after the certbot output you've shown above, but now just for Due to that, your www subdomain, which is missing from the certificate, is now giving certificate errors too.

You should reinstall (not reissue!) the certificate with both hostnames again and disable the ssl.conf configuration.


hmm. Thanks for the answer, so should I simply delete this file?

1 Like

Or change its ServerName to something else like localhost or, something not being used on the world wide web. Perhaps the configuration file contains some good default configuration values you don't want to disable.


I just removed site-available directory from the server and copied *.conf files inside the /etc/httpd/conf.d/ directory. Everything is fine now. thanks


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