See https://bjornlu.com/blog/trailing-slash-for-frameworks
- If people use
servitsy to serve content that would be served by GitHub pages, Cloudflare Pages, Netlify or some other host, having some control over whether URLs contain trailing slashes or not might be necessary to be close enough to prod.
- The behavior used by Cloudflare Pages is pretty good, I might try to make it the default.
I’m thinking something like:
trailingSlash value |
When matching filename.html |
When matching folder or folder/index.html |
off |
Do nothing |
Do nothing |
auto (default) |
Redirect /filename/ to /filename |
Redirect /folder to /folder/ |
always |
Redirect /filename to /filename/ |
Redirect /folder to /folder/ |
never |
Redirect /filename/ to /filename |
Redirect /folder/ to /folder |
See https://bjornlu.com/blog/trailing-slash-for-frameworks
servitsyto serve content that would be served by GitHub pages, Cloudflare Pages, Netlify or some other host, having some control over whether URLs contain trailing slashes or not might be necessary to be close enough to prod.I’m thinking something like:
trailingSlashvaluefilename.htmlfolderorfolder/index.htmloffauto(default)/filename/to/filename/folderto/folder/always/filenameto/filename//folderto/folder/never/filename/to/filename/folder/to/folder