Put it on your domain
How do I launch on my own domain without breaking SEO?
DNS, the env var everyone forgets, the redeploy that must follow, and how to verify canonical URLs and share cards actually moved with you.
Typical effort: 20 minutes
The recipe — paste this to your AI
# Recipe — put your site on your own domain (and don't strand your SEO)
Adding the domain in Vercel is the easy half. The half everyone misses: **this site composes
absolute URLs from `NEXT_PUBLIC_SITE_URL`** — canonical links, the sitemap, Open Graph/share
images, and JSON-LD structured data all use it. If you switch domains and don't update it,
search engines and social cards keep pointing at the old host, silently.
## Steps
1. **Vercel → your project → Settings → Domains → Add.** Add BOTH `yourdomain.com` and
`www.yourdomain.com`; pick one as primary (Vercel redirects the other — either choice
works, just be consistent). Follow Vercel's DNS instructions (an `A`/`ALIAS` record for the
apex, `CNAME` for `www`); certificates are automatic.
2. **Update the env var:** in Vercel → Settings → Environment Variables, set
`NEXT_PUBLIC_SITE_URL=https://yourdomain.com` (your primary, no trailing slash — see
`.env.example` for the variable's notes).
3. **Redeploy.** An env-var change alone does NOT rebuild the site (`DEPLOY.md` Gotcha 9) —
trigger a redeploy so the new URL bakes into the canonical/OG/sitemap output.
4. **Re-verify what's actually served:**
- `view-source:https://yourdomain.com` → the `<link rel="canonical">` and `og:url` must
name the NEW domain.
- `https://yourdomain.com/sitemap.xml` → every entry on the new domain.
- Paste a page into a social-card debugger (X/Facebook/LinkedIn) — the preview should
render with your brand, from the new host.
5. **If you changed domains (not just added one):** keep the old domain attached in Vercel so
it 308-redirects to the new one — inbound links and indexed pages keep working while
search engines re-crawl.
## Gotchas
- `GENESIS_API_ORIGIN` does NOT change — that's your API's origin, not your site's. Only
`NEXT_PUBLIC_SITE_URL` moves with your domain.
- The contact form, login cookies, and the `/api/v1` proxy are same-origin by design, so
they follow the new domain automatically — nothing to reconfigure.
- Analytics: if your GA4/GTM property filters by hostname, add the new domain there too.
Source of truth
This recipe ships inside the template as docs/prompts/set-up-a-custom-domain.md — this page renders that exact file. The repository is always the newest version: https://github.com/srisenmay/bringthefront-template. Clone the template and you get every recipe locally, versioned with the release you are on.