vercel / commerce

Next.js Commerce
https://demo.vercel.store
MIT License
11.21k stars 4.14k forks source link

sitemap.xml & robots.txt points to Vercel's domain #1324

Open danieldanielecki opened 5 months ago

danieldanielecki commented 5 months ago

Why is that happening if I have a custom domain? The links refer to my Vercel domain.

https://shop.ditectrev.com/robots.txt Screenshot 2024-04-15 at 08 44 19

https://shop.ditectrev.com/sitemap.xml Screenshot 2024-04-15 at 08 44 29

valiant1x commented 5 months ago

The problem is the use of NEXT_PUBLIC_VERCEL_URL as the baseUrl in several places across the code. This uses the internal Vercel domain rather than your prod deployment domain. Assuming you have configured TWITTER_SITE to match your prod domain, I recommend using that instead.

https://github.com/vercel/commerce/blob/610b0e86928bffeea94201dd0eeb9b62e9b1f5c0/app/robots.ts#L1