PHPackages                             mrssoft/yii2-url-redirect - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. mrssoft/yii2-url-redirect

ActiveYii2-extension[Utility &amp; Helpers](/categories/utility)

mrssoft/yii2-url-redirect
=========================

Extension for redirection from old url to new one

v1.0(8y ago)0111MITPHP

Since Nov 14Pushed 8y ago1 watchersCompare

[ Source](https://github.com/mrs2000/yii2-redirect)[ Packagist](https://packagist.org/packages/mrssoft/yii2-url-redirect)[ RSS](/packages/mrssoft-yii2-url-redirect/feed)WikiDiscussions master Synced 3d ago

READMEChangelogDependencies (1)Versions (2)Used By (0)

yii2-url-redirect
=================

[](#yii2-url-redirect)

Extension for redirection from old url to new one.

### Configure

[](#configure)

Add to config:

```
    'components' => [
        ...
        'redirect' => [
            'class' => 'mrssoft\redirect\UrlRedirect',
            'tableName' => '{{%redirect}}', // Table name
            'db' => 'db', // DB connection component
            'code' => 302, // Redirect status code
        ],
        'response' => [
            'as urlRedirect' => [
                'class' => 'mrssoft\redirect\UrlBehavior',
                'redirect' => 'redirect' // UrlRedirect component
            ]
        ],
        ...
    ]
```

Add the table to the database:

```
    CREATE TABLE `redirect` (
        `old_url` VARCHAR(255) NOT NULL,
        `new_url` VARCHAR(255) NOT NULL,
        `date` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
        PRIMARY KEY (`old_url`)
    )
    ENGINE=InnoDB
```

### Usage

[](#usage)

Add a link to the redirect database:

```
    Yii::$app->redirect->add('/old/url/', '/new/url');
```

Clear old links:

```
    Yii::$app->redirect->clear('-3 month');
```

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community5

Small or concentrated contributor base

Maturity63

Established project with proven stability

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

3104d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/9e69f6780ee8c8e5b2c10af66e1232ac3925766c6f2f83db1820f2ff9a590a62?d=identicon)[mrs2000](/maintainers/mrs2000)

---

Tags

yii2extensionredirect

### Embed Badge

![Health badge](/badges/mrssoft-yii2-url-redirect/health.svg)

```
[![Health](https://phpackages.com/badges/mrssoft-yii2-url-redirect/health.svg)](https://phpackages.com/packages/mrssoft-yii2-url-redirect)
```

###  Alternatives

[dmstr/yii2-cookie-consent

Yii2 Cookie Consent Widget

1452.6k](/packages/dmstr-yii2-cookie-consent)[richardfan1126/yii2-js-register

Yii2 widget to register JS into view

1357.2k7](/packages/richardfan1126-yii2-js-register)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
