Download the PHP package middlewares/redirect without Composer
On this page you can find all versions of the php package middlewares/redirect. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download middlewares/redirect
More information about middlewares/redirect
Files in middlewares/redirect
Package redirect
Short Description A redirect repository for PSR-15 middleware packages
License MIT
Homepage https://github.com/middlewares/redirect
Informations about the package redirect
middlewares/redirect
Middleware to redirect old urls to new urls SEO friendly.
Requirements
- PHP >= 7.2
- A PSR-7 http library
- A PSR-15 middleware dispatcher
Installation
This package is installable and autoloadable via Composer as middlewares/redirect.
Example
Usage
You can use an array or an object extending ArrayAccess
interface with the urls to redirect, the key is the old url and the value the new.
Optionally, you can provide a Psr\Http\Message\ResponseFactoryInterface
as the second argument to create the redirect responses. If it's not defined, Middleware\Utils\Factory will be used to detect it automatically.
permanent
Use temporary or permanent redirection HTTP status code for the response. Enabled by default.
query
Take the query part of the URI into account when matching redirects. Enabled by default.
method
This option accepts an array with the allowed HTTP request methods. (By default is: ['GET']
.)
Please see CONTRIBUTING for contributing details.
The MIT License (MIT). Please see LICENSE for more information.
All versions of redirect with dependencies
middlewares/utils Version ^3.0 || ^4.0
psr/http-server-middleware Version ^1.0