Add a custom domain to a v0 app on Vercel without 404s
Add a custom domain to a v0 app on Vercel without 404s
v0 apps 404 on a custom domain because the apex is pointed at the wrong IP, the www subdomain is missing, or Vercel is bound to the wrong project. Fix DNS at your registrar, add both apex and www in Vercel, pick a canonical redirect direction, and wait for SSL to provision. 20 minutes end to end.
Quick fix for Add a custom domain to a
Step 1 — Add the domain in Vercel
In Vercel → your project → Settings → Domains, add both yourapp.com and www.yourapp.com. Vercel will show the exact DNS records you need — usually an A record pointing at 76.76.21.21 for the apex and a CNAME pointing at cname.vercel-dns.com for www.
Deeper fixes when the quick fix fails
- 02
Step 2 — Set DNS at your registrar
At your domain registrar (Cloudflare, Namecheap, Google Domains), add exactly the records Vercel listed. Remove any old records for
@andwwwthat point somewhere else. If you use Cloudflare, set proxy to DNS only (grey cloud) until SSL is working, then decide whether to proxy. - 03
Step 3 — Pick a canonical: apex or www
In Vercel, click the three dots next to one of your two domains and select “Redirect to the other.” Pick one canonical (
www → apexis standard today). Never have both resolve independently — Google will split ranking signals between them. - 04
Step 4 — Handle trailing slashes and Next.js config
In
next.config.js, settrailingSlash: false(or leave default) and do not also redirect in middleware. Double redirects between trailing-slash variants and apex/www cause infinite loops. Keep it simple: one redirect layer, run by Vercel only. - 05
Step 5 — Wait for SSL and verify
Vercel provisions Let’s Encrypt automatically. It usually takes 1–5 minutes but can take longer if DNS is still propagating. Verify with
curl -I https://yourapp.com— you want a 200 on the canonical and a 308 on the non-canonical, both with a valid certificate.
Why AI-built apps hit Add a custom domain to a
v0 deploys to a preview URL on v0.dev or a Vercel-generated origin. Binding a custom domain requires DNS at your registrar, a matching domain added to your Vercel project, and an agreement between apex and www so one redirects to the other.
Getting any surface wrong — wrong A record, missing www, Vercel bound to a different project — returns 404 or DEPLOYMENT_NOT_FOUND. Trailing slashes and Next.js config can add a second redirect layer that confuses the browser further.
Diagnose Add a custom domain to a by failure mode
Match what you see in the browser to what needs fixing.
| Symptom | Root cause | Fix step |
|---|---|---|
| 404 on apex (yourapp.com) | Apex A record missing or wrong | Step 1 |
| Works on www, 404 on apex | Apex not added to Vercel project | Step 2 |
| DEPLOYMENT_NOT_FOUND | Domain bound to a different Vercel project | Step 3 |
| Infinite redirect loop | Apex and www both redirect at each other | Step 4 |
| SSL error / not secure warning | SSL still provisioning or DNS stale | Step 5 |
Related errors we fix
Still stuck with Add a custom domain to a?
Domain still 404-ing after you’ve tried everything? We fix these in under an hour.
- →404 on the apex, works on www (or vice versa)
- →SSL error won't go away
- →Redirect loop between apex and www
Add a custom domain to a questions
Why does my v0 app return 404 on the custom domain?+
Should I point the apex or the www to Vercel?+
Why does my v0 custom domain loop between apex and www?+
How long does SSL take to provision on Vercel?+
Does v0 charge extra for a custom domain?+
How much does it cost to have you set up the domain?+
Ship the fix. Keep the fix.
Emergency Triage restores service in 48 hours. Break the Fix Loop rebuilds CI so this error cannot ship again.
Hyder Shah leads Afterbuild Labs, shipping production rescues for apps built in Lovable, Bolt.new, Cursor, Replit, v0, and Base44. our rescue methodology.
Add a custom domain to a experts
If this problem keeps coming back, you probably need ongoing expertise in the underlying stack.