How to Fix a Website That Works Without WWW but Not With WWW
Domains & DNS · Self-help guide
If your main domain works but the www version does not, the www DNS record may be missing or incorrect. Log in to your DNS provider and open the DNS zone. Look for a record named www. Many websites use a CNAME record for www pointing to the main domain, such as yourdomain.co.uk. Some setups use an A record for www pointing to the same server IP as the main domain. Save the correct record and allow propagation time. Also check the hosting control panel to make sure the site accepts both the main domain and the www version. If HTTPS fails only on www, the SSL certificate may need to include it.