You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[v2] Sitemap contains links that result in 302s #2134
bugAn error in the Docusaurus core causing instability or issues with its executiondifficulty: intermediateIssues that are medium difficulty level, e.g. moderate refactoring with a clear test plan.mlhMajor League Hacking Fellowship
Hi. This isn't necessarily a bug report, but it is typically bad SEO practice for the sitemap to contain redirects. This is due to the fact that the URLs contained do not end with a /. This is a wider spread problem with linking in general across docusaurus, so I'm curious to hear what you think.
I think it depends more on the static site hosting provider. Or maybe not, because without trailing slash, this is about working with client navigation, so we really can safely add a slash at the end of the links.
Its because we're using client side navigation and during HTML rendering phase, it will render /test as /text/index.html.
However, depending on site hosting provider, it could request /test/index.html or /test.html when accessing /test for first page load (before client nav takes over)`.
Its a hard call to be honest :( not sure whats the best approach
I'm not against but don't really know the potential impact of such change, as it's related to how host providers serve files, and I'm not familiar with all that we currently support :)
Some hosts won't add any redirect / trailing slash, like Netlify (pretty URLs disabled) or Vercel, while others (Github Pages, Netlify with pretty URLs enabled) will redirect to a trailing slash
So you can upgrade and use trailingSlash, or change host
bugAn error in the Docusaurus core causing instability or issues with its executiondifficulty: intermediateIssues that are medium difficulty level, e.g. moderate refactoring with a clear test plan.mlhMajor League Hacking Fellowship
Activity
lex111 commentedon Dec 21, 2019
I think it depends more on the static site hosting provider. Or maybe not, because without trailing slash, this is about working with client navigation, so we really can safely add a slash at the end of the links.
endiliey commentedon Dec 25, 2019
Its because we're using client side navigation and during HTML rendering phase, it will render
/testas/text/index.html.However, depending on site hosting provider, it could request
/test/index.htmlor/test.htmlwhen accessing/testfor first page load (before client nav takes over)`.Its a hard call to be honest :( not sure whats the best approach
yangshun commentedon Jun 5, 2020
Seems like vector.dev uses a custom sitemap plugin that fixes this issue. Plugin src here.
I think we should standardize and make all the internal routes end with trailing slashes, for docs, sitemaps, and stuff. cc @lex111 @slorber
slorber commentedon Jun 5, 2020
I'm not against but don't really know the potential impact of such change, as it's related to how host providers serve files, and I'm not familiar with all that we currently support :)
slorber commentedon Jun 10, 2021
The next release includes a
trailingSlash: trueconfig option to force a trailing slash in links, URLs, canonical URLs, hreflang metas...See #3372
Use https://github.com/slorber/trailing-slash-guide to understand how your hosting provider behaves when serving the historical filename pattern
/path/index.html(file created for/path).Some hosts won't add any redirect / trailing slash, like Netlify (pretty URLs disabled) or Vercel, while others (Github Pages, Netlify with pretty URLs enabled) will redirect to a trailing slash
So you can upgrade and use
trailingSlash, or change host