RedirectController
class RedirectController
Redirects a request to another URL.
Methods
__construct(UrlGeneratorInterface $router = null, int $httpPort = null, int $httpsPort = null)
No description
redirectAction(Request $request, string $route, bool $permanent = false, $ignoreAttributes = false, bool $keepRequestMethod = false, bool $keepQueryParams = false)
Redirects to another route with the given name.
urlRedirectAction(Request $request, string $path, bool $permanent = false, string $scheme = null, int $httpPort = null, int $httpsPort = null, bool $keepRequestMethod = false)
Redirects to a URL.
Details
Response
redirectAction(Request $request, string $route, bool $permanent = false, $ignoreAttributes = false, bool $keepRequestMethod = false, bool $keepQueryParams = false)
Redirects to another route with the given name.
The response status code is 302 if the permanent parameter is false (default), and 301 if the redirection is permanent.
In case the route name is empty, the status code will be 404 when permanent is false and 410 otherwise.
Response
urlRedirectAction(Request $request, string $path, bool $permanent = false, string $scheme = null, int $httpPort = null, int $httpsPort = null, bool $keepRequestMethod = false)
Redirects to a URL.
The response status code is 302 if the permanent parameter is false (default), and 301 if the redirection is permanent.
In case the path is empty, the status code will be 404 when permanent is false and 410 otherwise.