PHPackages                             freeq/redirector - 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. freeq/redirector

ActiveLibrary

freeq/redirector
================

Manage your redirections easily.

1.0.1(8y ago)116[1 issues](https://github.com/patrykwozinski/redirector/issues)MITPHPPHP &gt;=7.1.0

Since Aug 12Pushed 8y ago1 watchersCompare

[ Source](https://github.com/patrykwozinski/redirector)[ Packagist](https://packagist.org/packages/freeq/redirector)[ RSS](/packages/freeq-redirector/feed)WikiDiscussions master Synced today

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

Redirector
==========

[](#redirector)

Redirect manager

[![Build Status](https://camo.githubusercontent.com/bb88754dc6fc82bc016da8054f84c827cf5112b5e652ce6e58928701075b889c/68747470733a2f2f7472617669732d63692e6f72672f70617472796b776f7a696e736b692f72656469726563746f722e706e673f6272616e63683d6d6173746572)](https://travis-ci.org/patrykwozinski/redirector)[![Total Downloads](https://camo.githubusercontent.com/bb64485d42beda220248004ef8591b3496d135e8c4e48690a4abb4c71a19973e/68747470733a2f2f706f7365722e707567782e6f72672f66726565712f72656469726563746f722f646f776e6c6f6164733f666f726d61743d666c61742d737175617265)](https://packagist.org/packages/freeq/redirector)[![Latest Stable Version](https://camo.githubusercontent.com/4674d6d74a7a8bebd3ff83b028ebf66f9fe93a9ddea12980e3c7a7ffaa8110d1/68747470733a2f2f706f7365722e707567782e6f72672f66726565712f72656469726563746f722f762f737461626c653f666f726d61743d666c61742d737175617265)](https://packagist.org/packages/freeq/redirector)

This package provides you with a simple tool to redirect users. You can easily manage everything.

Installation
------------

[](#installation)

Via Composer

```
$ composer require freeq/redirector
```

Using
-----

[](#using)

Use package everywhere you need. The best way to manage your redirections is to run it in Observer or other event listener. You should store redirections after saving to the database, drop them from store after removing database record. Every redirect object should implement `Redirectable` contract.

### Create manager

[](#create-manager)

Make instance of your redirections manager. It allows you to store/delete/flush/get data.

```
use Freeq\Redirector\Manager;

$redirect_object = Redirect::findById(1); // must implement Redirectable!

// Using file driver.
$storage = new FileStorage('/path/to/store/them');
$storage->setRedirect($redirect_object);
$manager = new Manager($storage);

// Using redis driver.
$storage = new RedisStorage(new Predis\Client());
$storage->setRedirect($redirect_object);
$manager = new Manager($storage);

// Otherwise u can use StorageFactory.
// $type is storage name (file or redis)
// $source is path for FileStorage or Predis Client for RedisStorage
$storage = StorageFactory::build($type, $source);
$storage->setRedirect($redirect_object);
$manager = new Manager($storage);
```

### Manage Redirectable object

[](#manage-redirectable-object)

Store object

```
$manager->store();
```

Drop it

```
$manager->delete();
```

Flush everything

```
$manager->flush();
```

Start redirection for given route

```
$manager->forward('my_route');
```

Classes
-------

[](#classes)

- `Freeq\Redirector\Manager` - allows you to manage.
- `Freeq\Redirector\StorageFactory` - is creating concrete class depending of passed 'type' to the manager constructor.
- `Freeq\Redirector\Storages\FileStorage` - driver which allows you to store redirections as mini files.
- `Freeq\Redirector\Storages\RedisStorage` - driver which allows you to store redirections as redis records.

Redirectable methods
--------------------

[](#redirectable-methods)

Your object which implements `Freeq\Redirector\Contracts\Redirectable` needs methods:

- `routeFrom()` - which route should be redirected.
- `routeTo()` - where did you want to go by your redirection (eg. ).
- `statusHttp()` - redirect using specific http statuses (301 or 302).
- `hash()` - hash is string similar to hashed routeFrom() by md5. It's redis key or filename.
- `expireAt()` - returns date to expire your redirection.

Contributing
------------

[](#contributing)

Please see [contributing.md](contributing.md) for details.

###  Health Score

21

—

LowBetter than 19% of packages

Maintenance0

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community5

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

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

Every ~9 days

Total

2

Last Release

3183d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/0dd3254347a1cfb5a5515c5492e519c22ba19f5c1123049b38a0d51fd3542c9d?d=identicon)[patrykwozinski](/maintainers/patrykwozinski)

---

Top Contributors

[![patrykwozinski](https://avatars.githubusercontent.com/u/17459288?v=4)](https://github.com/patrykwozinski "patrykwozinski (41 commits)")

---

Tags

routingPHP7redirections

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/freeq-redirector/health.svg)

```
[![Health](https://phpackages.com/badges/freeq-redirector/health.svg)](https://phpackages.com/packages/freeq-redirector)
```

###  Alternatives

[symfony/routing

Maps an HTTP request to a set of configuration variables

7.6k789.4M1.8k](/packages/symfony-routing)[nikic/fast-route

Fast request router for PHP

5.3k92.4M668](/packages/nikic-fast-route)[friendsofsymfony/jsrouting-bundle

A pretty nice way to expose your Symfony routing to client applications.

1.5k53.6M229](/packages/friendsofsymfony-jsrouting-bundle)[symfony-cmf/routing

Extends the Symfony routing component for dynamic routes and chaining several routers

29151.1M64](/packages/symfony-cmf-routing)[laminas/laminas-router

Flexible routing system for HTTP and console applications

3520.6M64](/packages/laminas-laminas-router)

PHPackages © 2026

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