Prevent trailing slash route handler
: shell
: prevent-trailing-slash
: middleware
: /modules/core/routing/services/prevent-trailing-slash-route-handler.js
PreventTrailingSlashRouteHandler
This handler registers itself as an Express middleware that permanently redirects all requests with a trailing slash. This ensures that content items have a single URL.
PreventTrailingSlashRouteHandler.register(scope, context)
Registers a middleware that will permanently redirect requests for URLs ending with a slash to the same URL without the trailing slash.
Kind: static method of PreventTrailingSlashRouteHandler
| Param | Type | Description |
|---|---|---|
| scope | object |
The scope. |
| context | object |
The context. |
| context.expressApp | object |
The Express application object. |