wmr icon indicating copy to clipboard operation
wmr copied to clipboard

(docs) URLs with trailing slashes

Open developit opened this issue 3 years ago • 4 comments

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.

developit avatar Jun 07 '21 01:06 developit

⚠️ 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

changeset-bot[bot] avatar Jun 07 '21 01:06 changeset-bot[bot]

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/)

developit avatar Jun 07 '21 20:06 developit

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)

marvinhagemeister avatar Jun 07 '21 20:06 marvinhagemeister

It seems you can only force URL normalisation, not turn it off. See https://docs.netlify.com/routing/redirects/redirect-options/#trailing-slash

zgoda avatar Aug 27 '21 12:08 zgoda