-
-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Do not distinguish between /page/ and /page #192
Comments
There was some tangentially-related discussion in #5. I definitely think we want to canonicalise URLs and 301 from the non-canonical one to the canonical one. I wonder if it might be slightly more complex than just removing the trailing slash though. If you're on (say) a blog index page, you probably want a relative link like In other words my hunch is that the default behaviour should be for 'leaf' pages to have the trailing slash removed, but 'branch' pages to keep it. (Stated differently, every page is a leaf page, but we remove the The fun part is figuring out
|
I think that writing links in the app is the responsibility of the application author, so we shouldn't have to worry about that. (I'd not want links written as It does make sense to me for the 301 redirects to be configurable (though that perhaps could be done later). We could make it a middleware that removes a trailing slash from any URL containing one via URL. If that middleware can be disabled via configuration then the user can add their own implementation that does whatever behavior they want. |
One fairly simple rule could be that if the page is served by an Next.js has some kind of config option for turning this on and off that I don't quite understand. |
I don't think |
Vercel also has configuration for this. I wonder what happens if you set them both to different values? https://vercel.com/docs/configuration#project/trailing-slash |
The more I think about this, the more I think we should just always remove trailing slashes (i.e. 301 from |
Ehhhhhhh I think the legitimate use case is /blog/ and /blog/slug. Preventing people from using nice relative URLs like the framers of the constitution intended sounds bad. |
But are we saying that the behaviour of Are there many examples of trailing slashes in the wild? Also, we have the convention of adding |
As I noted in Discord - I think I'm fine with deferring on the decision of how to configure this. No slash is definitely the more sensible default, and we can revisit this later after the public beta. |
Starting with no slashes for the beta and waiting until we get a use case for something else sounds like a sensible plan to me |
closed via #267 |
Currently, we're serving the same page on both
/url
and/url/
. It can be confusing because relative links behave differently and it's bad from a caching and SEO perspective. Should we rewrite the latter to the former with a 301?The text was updated successfully, but these errors were encountered: