Skip to content

Conversation

@bookernath
Copy link
Contributor

@bookernath bookernath commented Aug 8, 2025

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 Host header 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

<sitemapindex xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/siteindex.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
--
<sitemap>
<loc>https://store-vcijajnodd-1543376.mybigcommerce.com/xmlsitemap.php?type=pages&amp;page=1</loc>
</sitemap><sitemap>
<loc>https://store-vcijajnodd-1543376.mybigcommerce.com/xmlsitemap.php?type=products&amp;page=1</loc>
</sitemap><sitemap>
<loc>https://store-vcijajnodd-1543376.mybigcommerce.com/xmlsitemap.php?type=categories&amp;page=1</loc>
</sitemap><sitemap>
<loc>https://store-vcijajnodd-1543376.mybigcommerce.com/xmlsitemap.php?type=brands&amp;page=1</loc>
</sitemap><sitemap>
<loc>https://store-vcijajnodd-1543376.mybigcommerce.com/xmlsitemap.php?type=news&amp;page=1</loc>
</sitemap>
</sitemapindex>

After, on https://catalyst-canary-3e4nxxptx-bigcommerce-platform.vercel.app/sitemap.xml

<sitemapindex xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/siteindex.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
--
<sitemap>
<loc>https://catalyst-canary-3e4nxxptx-bigcommerce-platform.vercel.app/sitemap.xml?type=pages&amp;page=1</loc>
</sitemap><sitemap>
<loc>https://catalyst-canary-3e4nxxptx-bigcommerce-platform.vercel.app/sitemap.xml?type=products&amp;page=1</loc>
</sitemap><sitemap>
<loc>https://catalyst-canary-3e4nxxptx-bigcommerce-platform.vercel.app/sitemap.xml?type=categories&amp;page=1</loc>
</sitemap><sitemap>
<loc>https://catalyst-canary-3e4nxxptx-bigcommerce-platform.vercel.app/sitemap.xml?type=brands&amp;page=1</loc>
</sitemap><sitemap>
<loc>https://catalyst-canary-3e4nxxptx-bigcommerce-platform.vercel.app/sitemap.xml?type=news&amp;page=1</loc>
</sitemap>
</sitemapindex>

Internal URLs also work.

Migration

N/A

@changeset-bot
Copy link

changeset-bot bot commented Aug 8, 2025

⚠️ No Changeset found

Latest commit: d3318d0

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@vercel
Copy link

vercel bot commented Aug 8, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
catalyst-b2b Ready Ready Preview Comment Nov 21, 2025 10:31pm
catalyst-canary Ready Ready Preview Comment Nov 21, 2025 10:31pm
4 Skipped Deployments
Project Deployment Preview Comments Updated (UTC)
catalyst Ignored Ignored Nov 21, 2025 10:31pm
catalyst-au Ignored Ignored Nov 21, 2025 10:31pm
catalyst-uk Ignored Ignored Nov 21, 2025 10:31pm
catalyst-uplift-vertex Ignored Ignored Nov 21, 2025 10:31pm

@bookernath bookernath changed the title Proxy internal sitemaps for prettier sitemap URLs Proxy sitemaps within sitemap index for prettier sitemap URLs Aug 8, 2025
@bookernath bookernath force-pushed the sitemap-index-proxy branch from f682823 to 5ab180f Compare August 8, 2025 02:09
@bookernath bookernath force-pushed the sitemap-index-proxy branch from c092fde to 9c8bbfb Compare August 8, 2025 03:03
@bookernath bookernath force-pushed the sitemap-index-proxy branch from 2d3ac3d to 1d297f7 Compare August 8, 2025 03:21
@bookernath bookernath force-pushed the sitemap-index-proxy branch from 1d297f7 to 453cec5 Compare August 8, 2025 19:06
@bookernath bookernath force-pushed the sitemap-index-proxy branch from ed044d9 to ab9aafd Compare August 23, 2025 22:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants