SiteBaseRedirectResolver implements MiddlewareInterface
Resolves redirects of site if base is not / Can be replaced or extended by extensions if GeoIP-based or user-agent based language redirects need to happen.
Please note that the redirect usually does not contain the Query Parameters, as special query parameters like "id", "L" and "cHash" could then result in an error loop. One special case (adding a "/") is keeping the query parameters though.
Table of Contents
Interfaces
- MiddlewareInterface
Methods
- process() : ResponseInterface
- Redirect to default language if required
- isLanguageEnabled() : bool
- Checks if the language is allowed in Frontend, if not, check if there is valid BE user
Methods
process()
Redirect to default language if required
public
process(ServerRequestInterface $request, RequestHandlerInterface $handler) : ResponseInterface
Parameters
- $request : ServerRequestInterface
- $handler : RequestHandlerInterface
Return values
ResponseInterfaceisLanguageEnabled()
Checks if the language is allowed in Frontend, if not, check if there is valid BE user
protected
isLanguageEnabled(SiteLanguage $language[, BackendUserAuthentication|null $user = null ]) : bool
Parameters
- $language : SiteLanguage
- $user : BackendUserAuthentication|null = null