Many users type www before a domain name out of habit. If www.yourdomain.com shows a browser error, an SSL warning, or serves different content from your apex domain, you have a DNS or redirect configuration problem. Both versions should work - and one should 301-redirect to the other.
Why this happens
high
No CNAME or A record for www - DNS lookup fails
Your apex domain (yourdomain.com) has DNS records pointing to your server, but the www subdomain has no record at all. Browsers can't resolve www.yourdomain.com and show 'This site can't be reached'. The fix is to add a CNAME record for www pointing to your apex domain, or an A record pointing to your server IP.
www resolves but doesn't redirect - duplicate content splits SEO
Both yourdomain.com and www.yourdomain.com work and serve the same content. From a user perspective this seems fine, but Google sees them as two different websites with identical content. This splits your backlinks, PageRank, and search rankings across two versions instead of concentrating them on one. Set up a 301 redirect from one to the other.
Not sure which of these apply to your domain?
Run a free scan - 26 checks in under 10 seconds.
No signup. No install. Just enter your domain.
Frequently asked questions
Should I use www or the apex domain (without www)?
Either works - pick one and stick with it. The apex domain (yourdomain.com) is simpler and more modern. www is sometimes preferred for large companies that need to use CNAME for CDN routing (apex domains can't be CNAME'd in standard DNS). For most indie and SaaS products, yourdomain.com is the right choice. Whatever you choose, 301-redirect the other to it.
Why does www work in some browsers but not others?
Browsers and ISPs cache DNS responses differently. A CNAME record you just added might be cached from before (NXDOMAIN cached). Try from a different network or use Google's DNS checker: toolbox.googleapps.com/apps/checkmx. If www was never set up, some DNS resolvers cache the 'not found' result for hours.
Does it matter for SEO which version I use?
What matters is consistency - pick one canonical version and redirect the other. Google will consolidate all ranking signals (backlinks, content) to the canonical version. Using a canonical tag on each page pointing to the chosen version also helps. The choice between www and apex doesn't directly affect rankings.
I set up a redirect but it's not working - why?
Common reasons: the redirect is set at the app level but DNS for www doesn't point to your server at all (browser never reaches the app to follow the redirect), SSL certificate doesn't cover www (HTTPS error before redirect), or DNS propagation hasn't completed (wait up to 48 hours). Use curl -I https://www.yourdomain.com to check the response headers.