-
Notifications
You must be signed in to change notification settings - Fork 340
Proxy sitemaps within sitemap index for prettier sitemap URLs #2515
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: canary
Are you sure you want to change the base?
Conversation
|
|
The latest updates on your projects. Learn more about Vercel for GitHub.
4 Skipped Deployments
|
f682823 to
5ab180f
Compare
c092fde to
9c8bbfb
Compare
2d3ac3d to
1d297f7
Compare
1d297f7 to
453cec5
Compare
ed044d9 to
ab9aafd
Compare
ab9aafd to
605bc45
Compare
605bc45 to
d3318d0
Compare
What/Why?
Catalyst's sitemap was using the channel canonical URL for the internal sitemap URLs, in order to avoid the complexity of proxying these internally via Catalyst itself and provide a reliable way to fetch them. Research shows this is OK for SEO, but we've received a steady stream of customer feedback indicating that having internal sitemap URLs that match the domain of the website is preferable.
This PR does that, by proxying the sitemap index, rewriting the internal URLs for the sitemap to live on
https://store.com/sitemap.xml?..., and then proxies those requests for the actual sitemaps as well.Since Next.js does not provide a variable to easily understand the "production" hostname for the app, I am relying on on the
Hostheader for this.Based on feedback from @apledger I have extracted it into its own package to abstract the complexity and make it easier to update later via a version bump.
Testing
Before, from https://catalyst-canary.store/sitemap.xml
After, on https://catalyst-canary-3e4nxxptx-bigcommerce-platform.vercel.app/sitemap.xml
Internal URLs also work.
Migration
N/A