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

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

zangane/smart-redirector
========================

A powerful and flexible PHP redirect handler with time, IP, and user-agent conditions.

00PHP

Since May 24Pushed 11mo agoCompare

[ Source](https://github.com/zangane/SmartRedirector)[ Packagist](https://packagist.org/packages/zangane/smart-redirector)[ RSS](/packages/zangane-smart-redirector/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

SmartRedirector (for PHP)
=========================

[](#smartredirector-for-php)

SmartRedirector is a powerful and flexible redirection handler for PHP applications. It allows you to manage HTTP redirects based on time limits, IP rules, user-agent conditions, and more. Ideal for shortlinks, campaign tracking, or dynamic routing.

🔧 Features
----------

[](#-features)

- Easy and dynamic redirect rules
- HTTP status code control (301, 302, etc.)
- Expiry date/time support
- IP-based allow/block rules
- User-Agent based redirection
- JSON-based configuration for easy customization
- Composer-ready structure

📦 Installation
--------------

[](#-installation)

```
composer require zangane/smart-redirector

```

🧠 Usage
-------

[](#-usage)

```
require "vendor/autoload.php";

use Zangane\SmartRedirector\Redirector;

$redirector = new Redirector("redirect-rules.json");
$redirector->handle();
```

⚙️ Configuration (redirect-rules.json)
--------------------------------------

[](#️-configuration-redirect-rulesjson)

```
[
  {
    "path": "promo",
    "target": "https://example.com/promo",
    "status": 302,
    "expire_at": "2025-12-31 23:59:59",
    "ip_allow": ["1.2.3.4"],
    "user_agent_block": ["bot", "curl"]
  }
]
```

📁 Directory Structure
---------------------

[](#-directory-structure)

```
- src/
  - Redirector.php
- examples/
  - basic.php
- redirect-rules.json
- logs/
  - access.log
- LICENSE
- README.md

```

📜 License
---------

[](#-license)

MIT License — see the [LICENSE](LICENSE) file for details.

🧬 Clone This Project
--------------------

[](#-clone-this-project)

```
git clone https://github.com/zangane/SmartRedirector.git

```

###  Health Score

14

—

LowBetter than 2% of packages

Maintenance37

Infrequent updates — may be unmaintained

Popularity0

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity14

Early-stage or recently created project

 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/7d38b9d21c2913fa1da9e6c63976541b7a2e69981a650862745512fd5b928cb2?d=identicon)[zangane](/maintainers/zangane)

---

Top Contributors

[![zangane](https://avatars.githubusercontent.com/u/8500880?v=4)](https://github.com/zangane "zangane (14 commits)")

### Embed Badge

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

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

###  Alternatives

[asinfotrack/yii2-audittrail

Yii2-audittrail is a behavior and a set of widgets to track all modifications performed on a model

1727.0k](/packages/asinfotrack-yii2-audittrail)

PHPackages © 2026

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