alex-kish/yii2-redirect-manager

Yii 2 URL redirect manager

Maintainers

Package info

github.com/alex-kish/yii2-redirect-manager

Type:yii2-extension

pkg:composer/alex-kish/yii2-redirect-manager

Statistics

Installs: 1

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

dev-main 2022-06-12 20:56 UTC

This package is auto-updated.

Last update: 2026-03-13 05:43:05 UTC


README

RedirectManager - if you need to redirect the user from one page to another. Like UrlManager, but redirect.

REQUIREMENTS

The minimum requirement by this project template that your Web server supports PHP 7.4.

INSTALLATION

The preferred way to install this extension is through composer:

composer require alex-kish/yii2-redirect-manager:"*"

CONFIGURATION

To use this extension, you have to configure the RedirectManager class in your application configuration:

return [
    //....
    'bootstrap' => ['redirectManager'],
    //....
    'components' => [
        'redirectManager' => [
            'class' => alexKish\redirectManager\RedirectManager::class,
            'rules' => [
                '/from-1' => '/to-1',
                '/from-2' => '/to-2',
                [
                    'from' => '/from-3',
                    'to' => '/to-3',
                    'statusCode' => alexKish\redirectManager\RedirectRule::REDIRECT_STATUS_CODE_MOVED_TEMPORARILY
                ],
            ],
        ],
    ]
];