wmr
wmr copied to clipboard
(docs) URLs with trailing slashes
It looks like Netlify automatically redirects to URLs with trailing slashes (go to wmr.dev/docs
, then reload). I'm not sure if there's a way to turn that off on the Netlify side? If not, we can just generate them with trailing slashes to match.
⚠️ No Changeset found
Latest commit: 0eb75a39398ffae356fedd641f3360c24c6f66b0
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
What do you mean by dealing with it in the router? Something like a config for "add trailing slash"? (would have to be a regex to prevent it being appended to index.html/
)
Nah, rather that the regex is more loose and matches both with and without trailing slashes for the same route.
/blog/:id -> /blog/post-a = match
-> /blog/post-a/ = match
(Might be misunderstanding the issue at hand when it comes to netlify)
It seems you can only force URL normalisation, not turn it off. See https://docs.netlify.com/routing/redirects/redirect-options/#trailing-slash