nuxt-community / sitemap-module

Sitemap Module for Nuxt 2
https://sitemap.nuxtjs.org
MIT License
685 stars 129 forks source link

URLs are missing trailing-slash at the end #268

Closed ma-vo closed 1 year ago

ma-vo commented 1 year ago

Your auto-generated sitemap creates URLs which lead to sites of the status 301 (permanently redirected). This lead to confused or even broken crawlers. Most of the crawlers are expacting a status of 200 (ok).

This URL is generated by your module: https://DOMAIN.com/subpage This URL would be correct https://DOMAIN.com/subpage/

The ending trailing-slash is mandatory.

NicoPennec commented 1 year ago

Nuxt 2.x generate each route without trailing-slash by default. the root cause is not about the sitemap module.

But the module have a trailingslash option to handle that (and read details about 301 in the docs): https://sitemap.nuxtjs.org/usage/sitemap-options#trailingslash-optional---boolean

ma-vo commented 1 year ago

Great! Missed that option. Thanks @NicoPennec