PHPackages                             rudra/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. [Framework](/categories/framework)
4. /
5. rudra/redirect

ActiveLibrary[Framework](/categories/framework)

rudra/redirect
==============

Rudra framework

v26.7(1w ago)11.1k4MPL-2.0PHPPHP ^8.3CI passing

Since Jun 27Pushed 1w ago1 watchersCompare

[ Source](https://github.com/Jagepard/Rudra-Redirect)[ Packagist](https://packagist.org/packages/rudra/redirect)[ RSS](/packages/rudra-redirect/feed)WikiDiscussions master Synced 4d ago

READMEChangelog (5)Dependencies (4)Versions (6)Used By (4)

Rudra-Redirect / Перенаправление | [API](https://github.com/Jagepard/Rudra-Redirect/blob/master/docs.md "Documentation API")
----------------------------------------------------------------------------------------------------------------------------

[](#rudra-redirect--перенаправление--api)

[![PHPUnit](https://github.com/Jagepard/Rudra-Redirect/actions/workflows/php.yml/badge.svg)](https://github.com/Jagepard/Rudra-Redirect/actions/workflows/php.yml)[![Maintainability](https://camo.githubusercontent.com/893ebc75ea2cfeb8b867e48976fecb6e6eb5ffcd60ef64a6dd05b360b6979737/68747470733a2f2f716c74792e73682f67682f4a616765706172642f70726f6a656374732f52756472612d52656469726563742f6d61696e7461696e6162696c6974792e737667)](https://qlty.sh/gh/Jagepard/projects/Rudra-Redirect)[![CodeFactor](https://camo.githubusercontent.com/d484dd868e6b6723ff955dcea9649123f120a2bd15be3ceac86b6e52a59134b1/68747470733a2f2f7777772e636f6465666163746f722e696f2f7265706f7369746f72792f6769746875622f6a616765706172642f72756472612d72656469726563742f6261646765)](https://www.codefactor.io/repository/github/jagepard/rudra-redirect)

A lightweight HTTP redirection component for the Rudra Framework.

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

[](#installation)

```
composer require rudra/redirect
```

#### Usage

[](#usage)

##### Basic redirection

[](#basic-redirection)

```
use Rudra\Redirect\RedirectFacade as Redirect;

// Simple redirect (302 Found)
Redirect::run('https://example.com/new-page');

// Permanent redirect (301 Moved Permanently)
Redirect::run('https://example.com/new-page', '', 301);
```

#### Redirect types

[](#redirect-types)

##### The component supports three redirect types:

[](#the-component-supports-three-redirect-types)

```
// Full URL — sends "Location: " + your URL as-is
Redirect::run('https://example.com/page', 'full');

// Basic URL — prepends "http://" automatically
Redirect::run('example.com/page', 'basic');

// Secure URL — prepends "https://" automatically
Redirect::run('example.com/page', 'secure');
```

If an unknown type is passed, the component falls back to the base URL from the configuration `Rudra::config()->get('url') . '/'`.

#### Setting response code only

[](#setting-response-code-only)

```
Redirect::responseCode(404);
```

#### Supported HTTP status codes

[](#supported-http-status-codes)

The component supports all standard HTTP status codes (1xx–5xx), including:

- 1xx — Informational (100 Continue, 101 Switching Protocols, 102 Processing, 103 Early Hints)
- 2xx — Success (200 OK, 201 Created, 204 No Content, etc.)
- 3xx — Redirection (301 Moved Permanently, 302 Found, 307 Temporary Redirect, 308 Permanent Redirect, etc.)
- 4xx — Client errors (400 Bad Request, 401 Unauthorized, 403 Forbidden, 404 Not Found, 418 I'm a teapot, etc.)
- 5xx — Server errors (500 Internal Server Error, 502 Bad Gateway, 503 Service Unavailable, etc.) The full list is available in `Redirect::CODE_MESSAGES`.

License
-------

[](#license)

This project is licensed under the **Mozilla Public License 2.0 (MPL-2.0)** — a free, open-source license that:

- Requires preservation of copyright and license notices,
- Allows commercial and non-commercial use,
- Requires that any modifications to the original files remain open under MPL-2.0,
- Permits combining with proprietary code in larger works.

📄 Full license text: [LICENSE](./LICENSE)
🌐 Official MPL-2.0 page:

###  Health Score

50

—

FairBetter than 95% of packages

Maintenance98

Actively maintained with recent releases

Popularity21

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity56

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 ~90 days

Total

5

Last Release

11d ago

Major Versions

v25.12 → v26.12025-12-30

PHP version history (2 changes)v25.6PHP &gt;=8.3

v26.7PHP ^8.3

### Community

Maintainers

![](https://www.gravatar.com/avatar/75e65761bdd94035d1c783773a706d5722ce3164fe55d9722581c2cb4a642d8c?d=identicon)[jagepard](/maintainers/jagepard)

---

Top Contributors

[![Jagepard](https://avatars.githubusercontent.com/u/4591345?v=4)](https://github.com/Jagepard "Jagepard (119 commits)")

---

Tags

redirectredirectionrudraredirectredirection

### Embed Badge

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

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

PHPackages © 2026

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