Configurable trailing slashes
J
Jim Garrison
Right now, when hosting a static website on Render, the file page1/index.html is available both at /page1 and at /page1/. However, if the page contains any relative links, it is impossible for both URLs to reference these links correctly. Most web servers handle this by redirecting /page1 to /page1/. Netlify does this as well. Vercel works the same way as Render in its default mode, but it also allows one to configure trailing slash behavior (always or never) in configuration.
Log In
A
Alvin Crespo
Would really love this feature as I've migrated my blog to another service and now trailing slashes are messing up redirects.
A
Alvin Crespo
For now, removing the content from my static site generator addresses the issue but it would be nice to have the trailing slash redirect because I can keep the content for historical reference.
N
Nicolas Jeanne
Was looking for another provider because Cloudflare Pages don't allow this, but if Render don't allow to remove trailing slashes I'm not going to use it either, this is a top-priority feature for static hosting
I need website.com/blog/ => website.com/blog
K
Kyle Roth
This feature is critical for sites generated with Hugo, because by default all pages are created as index pages to make the links prettier. As it stands, this breaks all relative links because links that work with the trailing slash won't work without it, and vice versa.
Alan Pennell-Smith
Options similar to Gatsby Cloud would probably be a good start, Ignore/Always/Never.
Covered in more detail here: https://github.com/gatsbyjs/gatsby/discussions/34205
I
Ian Beck
I'm running into this problem, as well. I'm building out a Vue router-based app, and while I can rewrite everything to the index.html, I cannot enforce server-level trailing slashes (or lack thereof), which is a nasty SEO problem because it means my site will appear to have a bunch of duplicated content (since
/foo
and /foo/
are technically differnt resources).J
Jim Garrison
I found a workaround: configure the following redirects:
/:a
to /:a/
, /:a/:b
to /:a/:b/
, and so on, with as many letters as nested directories on the site.EDIT: Nevermind, the above suggestion indeed fixes the trailing slashes, but it has a serious side effect: all missing urls will return an infinite series of redirects instead of a 404-not-found page.