How would one handle forcing trailing slashes with the reach router? I tried using Redirect manually since I couldn't find any global props for it, but as the path ranking seems to ignore trailing slashes, this results in an infinite redirect loop:
<Router>
<Redirect from="/path" to="/path/" />
<Component path="/path/" />
</Router>
+1
from my understanding, a trailing slash is helpful in describing a "folder", or a "base uri" in a server-side router, in accordance to rfc 3986, which describes a standard path resolution including relative paths (check section 5).
I believe it's also similar to how a unix path resolution works.
imo it might be worthwhile to use this as a convention.
I am also interested in this answer: some sort of a "strict" mode for matching trailing slashes? Another way to look at a trailing slash is as creating a zero-length path segment at the end - would be great to see a way to handle this more explicitly.
I wonder if there is a way to enforce a redirect to have consistent URLs from an SEO perspective. For example, a component
<Component path="app/someitem/:itemId" />
Becomes available at both /app/someitem/12345 and /app/someitem/12345/
Is this still an issue? This is coming up on Google 2 years later and I have the exact same request
Most helpful comment
Is this still an issue? This is coming up on Google 2 years later and I have the exact same request