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
Requires
- php: ^7.0
- psr/http-message: ^1.0
Requires (Dev)
- guzzlehttp/guzzle: ^6.3
- phpunit/phpunit: ^6.3
- squizlabs/php_codesniffer: ^3.4
This package is auto-updated.
Last update: 2024-12-08 21:06:31 UTC
README
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