Works on www but not without? Fix DNS
You bought a domain, connected it to the site you built with Lovable, Bolt, Replit, v0 or Cursor, and it worked. Then a friend types the address without the "www", or with it, and gets an error page, a security warning or someone else's parking page. Or it all worked for a week and then the padlock turned into a red warning. Your site didn't change. The problem lives in your domain settings, and it is easy to miss because the address you test every day still works.
The symptom
www.yourapp.comloads, butyourapp.comfails, or the other way round.- The browser shows a certificate or "connection is not private" warning on one version of the address.
- One version shows a registrar parking page, an old site or a default host page instead of your site.
- It works on your own laptop and phone, but some visitors report it doesn't load at all.
The cause
To the internet, yourapp.com (the bare or "apex" domain) and www.yourapp.com are two separate names. Each needs its own DNS record pointing at your host, and each needs a valid security certificate. Most builders and hosts walk you through connecting one of them. If only one was set up, the other keeps pointing wherever it pointed before, often your registrar's parking page.
The usual ways this goes wrong:
- Only one name was added. The host knows about
wwwbut not the bare domain, or the reverse, so it can't serve or secure the missing one. - Old records left behind. A leftover record from the registrar, a previous site or a website builder you tried earlier still answers for one of the names. Two conflicting records for the same name can make the site load for some visitors and fail for others.
- The certificate never finished. Hosts usually issue certificates automatically, but only after DNS points at them. If DNS was wrong when you connected the domain, the certificate can stay pending or fail quietly.
- A proxy or CDN in the middle. If your DNS provider also proxies traffic, its security settings have to match your host's, or visitors can see certificate errors or redirect loops.
- No redirect between the two. Even when both work, without a redirect search engines and visitors see two copies of your site.
Step-by-step diagnosis
- Test all four versions in a private window:
http://yourapp.com,https://yourapp.com,http://www.yourapp.comandhttps://www.yourapp.com. Note which ones load your site, which redirect, and which fail. - Look up the DNS records for both names with a public DNS lookup tool or
dig yourapp.comanddig www.yourapp.com. Compare them with the exact records your host asks for in its domain settings. - Look for duplicates. More than one A record, or an A record plus a CNAME on the same name, pointing to different places, is a common cause of "works for me, not for them".
- Check the certificate. Click the padlock or warning on each version and check which names the certificate covers and whether it is valid.
- Check your host's domain page. Most hosts show each connected domain with a status such as verified, pending or failed. A pending or failed status tells you where to look.
Fixes per builder or host
Lovable, Bolt and other builders with built-in hosting
- Open the project's domain settings and make sure both the bare domain and
wwware connected if your builder supports both, then copy the records it shows into your DNS provider exactly. - Delete old records for the same names that point anywhere else, including registrar parking records.
- Wait for the status to show as verified and the certificate to be issued before sharing the link.
Replit deployments
- Link the custom domain to the deployment itself, not the workspace, and add the records Replit gives you for each name you want to use.
v0 and Cursor projects on Vercel or Netlify
- Add both names in the host's domain settings. Both hosts let you choose one as the main address and redirect the other to it.
- If your DNS is managed somewhere with its own proxy, follow the host's guide for that setup, or turn the proxy off for these records while you test.
How to verify
- All four versions of the address end up on the same
httpsaddress with a valid padlock. - DNS lookups for both names show only the records your host asked for.
- Your host's domain page shows both names as verified, with certificates issued.
Prevention
- Pick one main address and redirect the other to it, so every link people share ends up in the same place.
- Clean up DNS when you switch hosts. Write down the records you remove and add, so nothing stale is left behind.
- Use the main address everywhere: in your site's settings, auth redirect URLs, emails and social profiles.
- Re-test after any DNS change, and check the certificate expiry date now and then, so a renewal that quietly fails doesn't turn your padlock red.
