The Redirect service provides a method to redirect to an internal page or a full URL.
Since this service is based on the 'Location' header, it must be applied before any content is rendered. The redirection can be executed in a controller or middleware, for example:
Additionally, the Redirect object can be obtained through dependency injection using the Hleb\Reference\Interface\Redirect interface.
To redirect to a route address by its name, use Redirect together with the Router service, which allows you to retrieve this address.