Skip to content

Commit 334a4f7

Browse files
committedNov 24, 2024·
fix: support root sitemaps path prefix
1 parent 4965d32 commit 334a4f7

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed
 

Diff for: ‎src/module.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,9 @@ declare module 'vue-router' {
336336
if (typeof config.sitemaps === 'object') {
337337
for (const k in config.sitemaps) {
338338
nuxt.options.nitro.routeRules[joinURL(config.sitemapsPathPrefix, `/${k}.xml`)] = routeRules
339-
nuxt.options.nitro.routeRules[`/${k}-sitemap.xml`] = { redirect: joinURL(config.sitemapsPathPrefix, `${k}.xml`) }
339+
if (config.sitemapsPathPrefix && config.sitemapsPathPrefix !== '/') {
340+
nuxt.options.nitro.routeRules[`/${k}-sitemap.xml`] = { redirect: joinURL(config.sitemapsPathPrefix, `${k}.xml`) }
341+
}
340342
}
341343
}
342344
else {

0 commit comments

Comments
 (0)
Please sign in to comment.