rekurzia/yii2-redirect
Composer 安装命令:
composer require rekurzia/yii2-redirect
包简介
Simple Application class which tries to redirect to one of specified routes before handling request.
README 文档
README
Custom Application class which tries to redirect to one of specified routes before handling request.
It's useful if you moved website and forgot to set redirects properly and receiving many 404 Not Found errors.
Redirects go through standard \yii\helpers\Url::to() function, so they'll be 302 Found redirects.
Installation
Using Composer:
composer require rekurzia/yii2-redirect
Usage
Change your entry script (index.php) to use this class:
(new Rekurzia\redirect\Application($config))->run();
And add new routes through redirectRoutes option:
$config['redirectRoutes'] = [ 'some/route' => ['/site/index'], 'another/route' => ['/site/index', 'page' => 'another'], 'some/route?a=b&c=d' => ['/site/index', 'page' => 'abcd'], 'outside/route' => 'http://www.yiiframework.com', ];
License
MIT. See LICENSE file.
统计信息
- 总下载量: 113
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2016-01-31