diff --git a/lib/api/sitemap/index.ts b/lib/api/sitemap/index.ts index 2760be22..37d2a59e 100644 --- a/lib/api/sitemap/index.ts +++ b/lib/api/sitemap/index.ts @@ -16,7 +16,8 @@ export const generateSitemapUrl = ( locale: string, preserveLocale = false ) => { - const segments = uri === CRAFT_HOMEPAGE_URI ? [] : [encodeURIComponent(uri)]; + const segments = + uri === CRAFT_HOMEPAGE_URI ? [] : uri.split("/").map(encodeURIComponent); if (preserveLocale || locale !== fallbackLng) { segments.unshift(locale);