middlewares/redirect

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

Homepage:

Size: 22

Language: PHP

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

middlewares/redirect

Latest Version on Packagist Software License Build Status Quality Score Total Downloads SensioLabs Insight

Middleware to redirect old urls to new urls SEO friendly.

Requirements
Installation

This package is installable and autoloadable via Composer as middlewares/redirect.

oser require middlewares/redirect
Example
patcher = new Dispatcher([
(new Middlewares\Redirect(['/old-url' => '/new-url']))
    ->permanent(false)
    ->query(false)
    ->method(['GET', 'POST'])


ponse = $dispatcher->dispatch(new ServerRequest());
Options
__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.


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.