Just wondering why my domain sub1.io/ navigates to sub1.io (but not a redirect status code), but sub1.io/datacentres redirects to sub1.io/datacentres/.
**Edit: what’s with the single input element to type a question?
A path separator when there is no path in the URL is removed by your browser because it’s meaningless. The URL specification says:
A path-absolute-URL string must be U+002F (/) followed by a path-relative-URL string.
So that slash isn’t seen as part of the path even though the path you’re requesting is / in the Unix sense. This seems odd but is probably just so that slash is always optional, making the syntax easier.
Enforcement of the trailing slash on paths is opinionated behavior of Cloudflare Pages.
Actually, is it possible to align my site structure with that opinionated behaviour? ie so that it puts the trailing slash removing the need for the redirect?
I’m just confused because SEMRush is reporting a redirect from the non-trailing slash page to the trailing slash page. And having the inclusion of trailing slashes in any links fix that would feel like magic