Hello,
I’m facing an issue with my website domain setup and need help troubleshooting it.
My main domain www is not working or loading properly.
However, my other domain, withou www , is working perfectly without any issues.
Both are related to the same business, and I want www and non-www to work correctly as well.
Could you please help me check:
DNS configuration issues
Domain pointing or nameserver problems
SSL certificate issues
Hosting or server configuration problems
Redirect setup between both domains
I would like to understand why non-www is working, but www is not.
Please advise on how to fix this issue.
Thank you.
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Hi there,
This is almost always a missing DNS record. If your main domain works but www does not, you likely have an A record for the root domain but no CNAME or A record for www.
Check your DNS settings in DigitalOcean under Networking > Domains and make sure you have something like this:
A @ your-server-ip
CNAME www @
Or alternatively:
A @ your-server-ip
A www your-server-ip
If the DNS records look correct, the next thing to check is your web server config. Nginx and Apache need to explicitly list both yourdomain.com and www.yourdomain.com as server names, otherwise requests to www will not be handled correctly.
For Nginx:
server_name yourdomain.com www.yourdomain.com;
For SSL, if you are using Certbot make sure the certificate covers both versions:
sudo certbot --nginx -d yourdomain.com -d www.yourdomain.com
Start with the DNS records, that is the most likely cause. You can verify what is actually resolving using:
dig www.yourdomain.com
dig yourdomain.com
If one returns an IP and the other does not, that confirms it is a DNS issue.
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.