Why is Google indexing my vercel.app URL but not my main domain?

I launched an open-source library a couple of months ago. Initially, I used a vercel.app domain since I hadn’t bought a custom domain yet. The website got decent traffic using that. Later, I purchased a new domain, set up the sitemap, robots.txt, and metadata, and even ran it through Lighthouse checks. But Google still isn’t indexing my main domain—it seems to prefer the vercel.app URL :sweat_smile:. I even set the vercel.app link as canonical, but I’m still seeing this issue:

“Alternate page with proper canonical tag. These pages aren’t indexed or served on Google.”

What could I be missing?

Did you verify your new domain in Google Search Console?

Brentley said:
Did you verify your new domain in Google Search Console?

Yes, I did. I’ve even requested indexing a few times, but no luck so far.

Did you make sure to submit the sitemap for your new domain?

Brentley said:
Did you make sure to submit the sitemap for your new domain?

Yeah, the sitemap is submitted. But I might have messed up by setting the vercel.app as the canonical URL. I used this configuration:

“alternates: { canonical: ‘https://nextstepjs.vercel.app’, },”

Brentley said:
Did you make sure to submit the sitemap for your new domain?

If you’re seeing issues with indexing, it might be because of how redirects are set up. Make sure that your new domain is redirecting properly to the vercel.app domain or vice versa. Also, check if there are any mixed signals that might be confusing Google.

@Robbie
Thanks for the tip! I was using a 307 redirect, but I’ve updated it to a 308. Hoping this will help.