A redirect repository for PSR-15 middleware packages
Middleware to redirect old urls to new urls SEO friendly.
This package is installable and autoloadable via Composer as middlewares/redirect.
composer require middlewares/redirect
$dispatcher = new Dispatcher([ (new Middlewares\Redirect(['/old-url' => '/new-url'])) ->permanent(false) ->query(false) ->method(['GET', 'POST']) ]); $response = $dispatcher->dispatch(new ServerRequest());
The list of urls that must be redirected. It can be an array or an object implementing the
Use temporary or permanent redirection HTTP status code for the response. (Default:
Take the query part of the URI into account when matching redirects. (Default:
Array with allow HTTP request methods. (Default:
The MIT License (MIT). Please see LICENSE for more information.