Name: redirect
Owner: Middlewares
Description: Middleware to redirect old urls to new urls SEO friendly
Created: 2017-09-17 09:52:03.0
Updated: 2017-12-22 09:16:43.0
Pushed: 2018-01-27 13:04:26.0
Size: 22
Language: PHP
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
Middleware to redirect old urls to new urls SEO friendly.
This package is installable and autoloadable via Composer as middlewares/redirect.
oser require middlewares/redirect
patcher = new Dispatcher([
(new Middlewares\Redirect(['/old-url' => '/new-url']))
->permanent(false)
->query(false)
->method(['GET', 'POST'])
ponse = $dispatcher->dispatch(new ServerRequest());
__construct(array|ArrayAccess $redirects)
The list of urls that must be redirected. It can be an array or an object implementing the ArrayAccess
interface.
permanent(bool $permanent)
Use temporary or permanent redirection HTTP status code for the response. (Default: true
.)
query(bool $query)
Take the query part of the URI into account when matching redirects. (Default: true
.)
method(array $methods)
Array with allow HTTP request methods. (Default: ['GET']
.)
Please see CHANGELOG for more information about recent changes and CONTRIBUTING for contributing details.
The MIT License (MIT). Please see LICENSE for more information.