PHPackages                             rekurzia/yii2-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. rekurzia/yii2-redirect

ActiveLibrary

rekurzia/yii2-redirect
======================

Simple Application class which tries to redirect to one of specified routes before handling request.

v1.0.0(10y ago)11131MITPHP

Since Jan 31Pushed 10y agoCompare

[ Source](https://github.com/rekurzia/yii2-redirect)[ Packagist](https://packagist.org/packages/rekurzia/yii2-redirect)[ Docs](https://github.com/rekurzia/yii2-redirect)[ RSS](/packages/rekurzia-yii2-redirect/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (1)Dependencies (1)Versions (2)Used By (0)

Yii2 Redirect
=============

[](#yii2-redirect)

[![Latest Stable Version](https://camo.githubusercontent.com/c637aceacd7723e728bec96905a0930f6925c675709ae8990c80f65e353a5946/68747470733a2f2f706f7365722e707567782e6f72672f72656b75727a69612f796969322d72656469726563742f762f737461626c65)](https://github.com/rekurzia/yii2-redirect/releases)[![License](https://camo.githubusercontent.com/9f8776c91a46f38986f5e8d575fd0cbe9867f718ea5b8f523d01076b7976ba28/68747470733a2f2f706f7365722e707567782e6f72672f72656b75727a69612f796969322d72656469726563742f6c6963656e7365)](https://github.com/rekurzia/yii2-redirect/blob/master/LICENSE.md)

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
------------

[](#installation)

Using Composer:

```
composer require rekurzia/yii2-redirect

```

Usage
-----

[](#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
-------

[](#license)

MIT. See LICENSE file.

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community4

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

3754d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/8d6826c755fa3dabbbdcd1394694012fc1ae6dcd2fa5e4f242cd08e42108bd44?d=identicon)[ujovlado](/maintainers/ujovlado)

---

Tags

yii2applicationredirect

### Embed Badge

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

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

###  Alternatives

[vova07/yii2-start

Yii2-Start it's a small Yii 2 application template for your fast project start.

26811.1k7](/packages/vova07-yii2-start)[toriphes/yii2-console-runner

Runs console command in yii web application

29240.1k](/packages/toriphes-yii2-console-runner)[yiisoft/yii2-app-benchmark

Yii 2 Benchmark Application

241.0k](/packages/yiisoft-yii2-app-benchmark)

PHPackages © 2026

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