docs: redirect trailing slash page [skip ci]
Diff
docs/content/configuration/command-line-arguments.md | 4 ++--
docs/content/configuration/environment-variables.md | 2 +-
docs/content/features/trailing-slash-redirect.md | 12 ++++++++++++
docs/mkdocs.yml | 1 +
4 files changed, 16 insertions(+), 3 deletions(-)
@@ -10,7 +10,7 @@ The server can be configured via the following command-line arguments.
```
$ static-web-server -h
static-web-server 2.10.0
static-web-server 2.11.0
Jose Quintana <https://joseluisq.net>
A blazing fast and asynchronous web server for static files-serving.
@@ -89,7 +89,7 @@ OPTIONS:
a generic HTML error message [env: SERVER_ERROR_PAGE_50X=] [default: ./public/50x.html]
-p, --port <port> Host port [env: SERVER_PORT=] [default: 80]
--redirect-trailing-slash <redirect-trailing-slash>
Check for trailing slash in the requested directory uri and redirect permanent (308) to the same path with a
Check for a trailing slash in the requested directory uri and redirect permanent (308) to the same path with a
trailing slash suffix if it is missing [env: REDIRECT_TRAILING_SLASH=] [default: true]
-d, --root <root>
Root directory path of static files [env: SERVER_ROOT=] [default: ./public]
@@ -76,7 +76,7 @@ Enable cache control headers for incoming requests based on a set of file types.
It provides [The "Basic" HTTP Authentication Scheme](https://datatracker.ietf.org/doc/html/rfc7617) using credentials as `user-id:password` pairs, encoded using `Base64`. Password must be encoded using the [BCrypt](https://en.wikipedia.org/wiki/Bcrypt) password-hashing function. Default empty (disabled).
### REDIRECT_TRAILING_SLASH
Check for trailing slash in the requested directory uri and redirect permanent (308) to the same path with a trailing slash suffix if it is missing. Default `true` (enabled).
Check for a trailing slash in the requested directory URI and redirect permanent (308) to the same path with a trailing slash suffix if it is missing. Default `true` (enabled).
## Windows
The following options and commands are Windows platform-specific.
@@ -0,0 +1,12 @@
# Trailing Slash Redirect
**`SWS`** provides automatic trailing slash redirect support for directory requests.
This feature is enabled by default and can be controlled by the boolean `--redirect-trailing-slash` option or the equivalent [SERVER_REDIRECT_TRAILING_SLASH](./../configuration/environment-variables.md#redirect_trailing_slash) env.
```sh
static-web-server \
--port 8787 \
--root ./my-public-dir \
--redirect-trailing-slash true
```
@@ -142,6 +142,7 @@ nav:
- 'URL Rewrites': 'features/url-rewrites.md'
- 'URL Redirects': 'features/url-redirects.md'
- 'Windows Service': 'features/windows-service.md'
- 'Trailing Slash Redirect': 'features/trailing-slash-redirect.md'
- 'Platforms & Architectures': 'platforms-architectures.md'
- 'Migration from v1 to v2': 'migration.md'
- 'Changelog v2 (latest stable)': 'https://github.com/joseluisq/static-web-server/blob/master/CHANGELOG.md'