PHPackages                             frozzare/redirects - 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. [Parsing &amp; Serialization](/categories/parsing)
4. /
5. frozzare/redirects

ActiveUtility[Parsing &amp; Serialization](/categories/parsing)

frozzare/redirects
==================

Netlify's \_redirects file format parser

34PHPCI failing

Since Jan 8Pushed 6y ago1 watchersCompare

[ Source](https://github.com/frozzare/php-redirects)[ Packagist](https://packagist.org/packages/frozzare/redirects)[ RSS](/packages/frozzare-redirects/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (1)Used By (0)

Redirects
=========

[](#redirects)

[![Build Status](https://camo.githubusercontent.com/6a23fdef04a9e8a0813c75071c0f6ea50c8a2f692d291b37f9f182e3cd2721ef/68747470733a2f2f7472617669732d63692e6f72672f66726f7a7a6172652f7068702d7265646972656374732e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/frozzare/php-redirects)

Parse Netlify's \_redirects file [format](https://www.netlify.com/docs/redirects/).

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

[](#installation)

```
composer require frozzare/redirects

```

Usage
-----

[](#usage)

```
use Frozzare\Redirects\Redirects;

// or redirects() function.
$redirects = new Redirects(__DIR__ . '/_redirects');

// return array of rules.
$redirects->rules();

// match url against rule.
$redirects->match($url);

// get url to redirect to.
$redirects->url($url);
```

More examples in the [`tests/RedirectsTest.php`](tests/RedirectsTest.php)

License
-------

[](#license)

MIT © [Fredrik Forsmo](https://github.com/frozzare)

###  Health Score

18

—

LowBetter than 8% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity34

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/aacdbaebed26ea1ccdb7e37e2bfd2a572350e1d781d1c0b8830d444adb86104e?d=identicon)[frozzare](/maintainers/frozzare)

---

Top Contributors

[![frozzare](https://avatars.githubusercontent.com/u/14610?v=4)](https://github.com/frozzare "frozzare (6 commits)")

---

Tags

netlifyparserphpredirects

### Embed Badge

![Health badge](/badges/frozzare-redirects/health.svg)

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

###  Alternatives

[mtdowling/jmespath.php

Declaratively specify how to extract elements from a JSON document

2.0k472.8M135](/packages/mtdowling-jmespathphp)[opis/closure

A library that can be used to serialize closures (anonymous functions) and arbitrary data.

2.6k230.0M284](/packages/opis-closure)[masterminds/html5

An HTML5 parser and serializer.

1.8k242.8M228](/packages/masterminds-html5)[sabberworm/php-css-parser

Parser for CSS Files written in PHP

1.8k191.2M65](/packages/sabberworm-php-css-parser)[michelf/php-markdown

PHP Markdown

3.5k52.4M345](/packages/michelf-php-markdown)[jms/metadata

Class/method/property metadata management in PHP

1.8k152.8M88](/packages/jms-metadata)

PHPackages © 2026

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