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. [Utility &amp; Helpers](/categories/utility)
4. /
5. freeq/redirector

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

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 2w ago

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 18% of packages

Maintenance0

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community7

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

3234d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/17459288?v=4)[Patryk Woziński](/maintainers/patrykwozinski)[@patrykwozinski](https://github.com/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

[grumpydictator/firefly-iii

Firefly III: a personal finances manager.

23.8k69.4k](/packages/grumpydictator-firefly-iii)[lord/laroute

Access Laravels URL/Route helper functions, from JavaScript.

7902.0M8](/packages/lord-laroute)[bramus/router

A lightweight and simple object oriented PHP Router

1.1k478.8k53](/packages/bramus-router)[watson/active

Laravel helper for recognising the current route, controller and action

3263.7M14](/packages/watson-active)[sunrise/vin

VIN decoder for PHP 7.1+ based on ISO-3779

81136.8k](/packages/sunrise-vin)[wazum/sluggi

TYPO3 extension for URL slug management with inline editing, auto-sync, locking, access control, and redirects

41515.2k](/packages/wazum-sluggi)

PHPackages © 2026

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