Knowledge > Runbooks > Deployment > Domain Setup
Add a New Domain or Subdomain
Add a new domain or subdomain to the ChurchWiseAI portfolio and route it to the correct Vercel project.
Prerequisites
- Access to the DNS provider for the domain (see DNS reference below)
vercelCLI logged in (vercel whoami→churchwiseai-5386)- Write access to the relevant codebase (if a hostname rewrite is needed)
DNS Provider Reference
| Domain | DNS Provider |
|---|---|
| pewsearch.com | Vercel (DNS managed in Vercel dashboard) |
| All other domains | Porkbun |
Steps
1. Add the domain to Porkbun (or Vercel for pewsearch.com)
For Porkbun:
- Log in at porkbun.com
- Navigate to the domain → DNS Records
- Add an
Arecord:@→76.76.21.21(Vercel's IP) for apex domains - Add a
CNAMErecord:www→cname.vercel-dns.com.for www subdomains - For subdomains (e.g.,
app.example.com): addCNAME→cname.vercel-dns.com.
For pewsearch.com (Vercel DNS):
- Log in to Vercel Dashboard → Domains → add the subdomain there
DNS propagation takes 1–60 minutes typically (up to 48 hours worst case).
2. Add the domain to the Vercel project
vercel domains add <domain-or-subdomain> --project <project-name>
Example:
vercel domains add app.churchwiseai.com --project churchwiseai-web
Vercel will attempt to verify DNS and provision an SSL certificate automatically. Run:
vercel domains inspect <domain-or-subdomain>
Check that SSL status shows "Valid".
3. Verify the domain routes to the correct project
vercel ls --project <project-name>
The domain should appear in the project's domain list.
4. Add a hostname rewrite to middleware (if needed)
If the new domain needs to serve content from a specific path in churchwiseai-web (like how sermonwise.ai serves /sermons):
Open C:\dev\churchwiseai-web\src\middleware.ts and add the hostname rewrite rule:
if (hostname === 'newdomain.com' || hostname === 'www.newdomain.com') {
return NextResponse.rewrite(new URL('/your-path' + pathname, request.url))
}
Then deploy:
cd /c/dev/churchwiseai-web
git add src/middleware.ts
git commit -m "feat: add hostname rewrite for newdomain.com"
git push
5. Test the redirect chain
After DNS propagates and SSL is provisioned:
curl -I https://newdomain.com
Expected: HTTP/2 200 (or 301 if you have a www redirect). No certificate errors.
Also test in a browser and check for console errors.
6. Verify SSL certificate is valid
vercel domains inspect <domain>
SSL Certificate: Valid should appear.
Vertical Expansion Domains (Acquired)
When setting up a new vertical (funeral homes, auto repair, etc.), follow the same steps. These domains are already acquired:
| Domain | Vertical |
|---|---|
| funeralwiseai.com | Funeral Homes (#1) |
| memorialwiseai.com | Funeral Homes (#1) |
| veterinarywiseai.com | Veterinary (#3) |
Rollback
To remove a domain from a Vercel project:
vercel domains rm <domain> --project <project-name>
Also remove the DNS records from Porkbun if the domain is no longer needed.
See Also
- deploy-churchwiseai.md — deploying after middleware changes
- Agent memory:
reference_dns_providers.md— full DNS provider reference