middlewares/www
最新稳定版本:v2.1.0
Composer 安装命令:
composer require middlewares/www
包简介
Middleware to add or remove the www subdomain in the host uri and returns a redirect response
README 文档
README
Middleware to add or remove the www subdomain in the host uri and returns a redirect response. The following types of hosts wont be changed:
- The one word hosts, for example:
http://localhost. - The ip based hosts, for example:
http://0.0.0.0.
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/www.
composer require middlewares/www
Usage
Set true to add the www subdomain and false to remove it.
//Remove www $www = new Middlewares\Www(false); //Add www $www = new Middlewares\Www(true);
Optionally, you can provide a Psr\Http\Message\ResponseFactoryInterface as the second argument to create the redirect response (301). If it's not defined, Middleware\Utils\Factory will be used to detect it automatically.
$responseFactory = new MyOwnResponseFactory(); $www = new Middlewares\Www(true, $responseFactory);
Please see CHANGELOG for more information about recent changes and CONTRIBUTING for contributing details.
The MIT License (MIT). Please see LICENSE for more information.
统计信息
- 总下载量: 1.47k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 4
- 点击次数: 4
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2016-10-08