frozzare/redirects

Netlify's _redirects file format parser

Fund package maintenance!
www.buymeacoffee.com/frozzare

Installs: 4

Dependents: 0

Suggesters: 0

Security: 0

Stars: 3

Watchers: 2

Forks: 0

Open Issues: 0

Type:utility

dev-master 2020-01-08 09:48 UTC

This package is auto-updated.

Last update: 2024-11-08 20:49:37 UTC


README

Build Status

Parse Netlify's _redirects file format.

Installation

composer require frozzare/redirects

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

License

MIT © Fredrik Forsmo