How to Connect a Custom Domain to Vercel (Apex, www and Redirects)
· 3 min read · By PK Creative
Connecting a domain to Vercel is quick, but the choices you make about www and non-www affect SEO. Pick one primary host, redirect the other to it and make sure every setting in your project agrees.
Add the domain to your project
In your Vercel project, open Settings and then Domains. Enter your domain, such as pkcreative.in, and add it. Do the same for the www version. Vercel will show which DNS records are needed and whether the configuration is valid.
Set the DNS records
At your registrar or DNS provider, add the records that Vercel displays. Typically an A record for the apex domain points to Vercel's address, and a CNAME record for www points to Vercel's DNS name. If you prefer, you can move your nameservers to Vercel and let it manage everything. Use the exact values shown in your dashboard, because they can change.
Choose the primary host
Search engines should see one canonical address.
- Decide whether visitors see example.in or www.example.in.
- In Vercel Domains, set the other host to redirect to the primary.
- Use a permanent redirect so signals pass to the primary address.
- Avoid also adding a redirect in your application code, which can create a loop.
Make your site settings agree
Set your configured base URL, which drives canonical tags, the sitemap and robots.txt, to the primary host exactly, including https and the www choice. If these disagree, every sitemap URL will redirect and Search Console will report "Page with redirect". Also match the property you use in Search Console.
Verify and monitor
Test all four versions: http and https, with and without www. Each should end on the same https primary address in at most one redirect. After the change, resubmit your sitemap. Our guide on fixing Page with redirect explains validation, and our web team can handle the hosting setup for you.
Frequently asked questions
- Should I use www or non-www?
- Either is fine for SEO. Choose one and be consistent. Non-www is shorter, while www can offer some DNS flexibility.
- Why does my site redirect in a loop?
- Usually two redirects fighting each other, for example one in Vercel and another in code or at the registrar. Keep only one.
- Does changing the primary domain hurt SEO?
- Not if you use permanent redirects and update canonicals and sitemaps, though rankings may take time to settle.
- connect domain to Vercel
- Vercel custom domain
- Vercel www redirect
- apex domain DNS