Skip to content

Add trailingSlash option to redirect requests #52

@fvsch

Description

@fvsch

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions