webzod
account

Cover both the www and the bare domain in the certificate on Apache

tls.names.companion_not_covered · effort: minutes

Why it matters

The www and bare versions of the domain answer on HTTPS, but one of them is served with a certificate that is not issued for it. Visitors who type or follow that version see a security warning.

The fix

  1. Put one name in ServerName and the other in ServerAlias, and make sure the certificate lists both.
  2. Test the configuration and reload Apache.
/etc/apache2/sites-available/site-ssl.conf
<VirtualHost *:443>
    ServerName example.com
    ServerAlias www.example.com
    SSLEngine on
    SSLCertificateFile    /etc/letsencrypt/live/example.com/fullchain.pem
    SSLCertificateKeyFile /etc/letsencrypt/live/example.com/privkey.pem
</VirtualHost>

The examples use example.com. Replace it with your own domain.

Read the documentation (opens in a new tab)

Scan your domain to see whether this applies to you.