PHPackages                             madewithlove/htaccess-api-client - 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. [API Development](/categories/api)
4. /
5. madewithlove/htaccess-api-client

ActivePackage[API Development](/categories/api)

madewithlove/htaccess-api-client
================================

API client for the best htaccess tester in the world.

v3.0.0(3mo ago)933.5k↓57.6%11GPL-3.0-or-laterPHPPHP ^8.4CI passing

Since Nov 20Pushed 1mo ago7 watchersCompare

[ Source](https://github.com/madewithlove/htaccess-api-client)[ Packagist](https://packagist.org/packages/madewithlove/htaccess-api-client)[ GitHub Sponsors](https://github.com/madewithlove)[ RSS](/packages/madewithlove-htaccess-api-client/feed)WikiDiscussions main Synced 2d ago

READMEChangelog (7)Dependencies (15)Versions (20)Used By (1)

htaccess-api-client
===================

[](#htaccess-api-client)

[![Build status](https://github.com/madewithlove/htaccess-api-client/workflows/Continious%20Integration/badge.svg)](https://github.com/madewithlove/htaccess-api-client/actions?query=branch%3Amain)[![Latest Stable Version](https://camo.githubusercontent.com/15ae0eaed069a381339abc14ff87476c8ca58c7a96b259dfd9a2d9985c1ddf13/68747470733a2f2f706f7365722e707567782e6f72672f6d616465776974686c6f76652f68746163636573732d6170692d636c69656e742f76657273696f6e)](https://packagist.org/packages/madewithlove/htaccess-api-client)[![License](https://camo.githubusercontent.com/6c87ce1557b55669dd65f91aec6ed926ca612ea3bceb3e23f79736082cd79f49/68747470733a2f2f706f7365722e707567782e6f72672f6d616465776974686c6f76652f68746163636573732d6170692d636c69656e742f6c6963656e7365)](https://packagist.org/packages/madewithlove/htaccess-api-client)[![codecov](https://camo.githubusercontent.com/c8c446e179649ed918752d3cb191638b700c6e9de722a982195dfe1658a85a54/68747470733a2f2f636f6465636f762e696f2f67682f6d616465776974686c6f76652f68746163636573732d6170692d636c69656e742f6272616e63682f6d61696e2f67726170682f62616467652e737667)](https://codecov.io/gh/madewithlove/htaccess-api-client)

This is an API client to interact with the [Htaccess tester](https://htaccess.madewithlove.com/).

### Installation

[](#installation)

```
composer require madewithlove/htaccess-api-client
```

### Usage

[](#usage)

The package can be used with every PSR-compatible http client. In this example, we're going to be using guzzle's PSR adapter.

```
use Http\Factory\Guzzle\ServerRequestFactory;
use Http\Adapter\Guzzle6\Client;
use Madewithlove\HtaccessClient

$client = new HtaccessClient(
    new Client(),
    new ServerRequestFactory()
);

$response = $client->test(
    'http://localhost',
    'RewriteRule .* /foo [R]'
);

$response->getOutputUrl(); // "http://localhost/foo"
$response->getLines();
/*
array(1) {
  [0]=>
  object(Madewithlove\ResultLine)#30 (5) {
    ["line":"Madewithlove\ResultLine":private]=> string(23) "RewriteRule .* /foo [R]"
    ["message":"Madewithlove\ResultLine":private]=> string(98) "The new url is http://localhost/foo
Test are stopped, a redirect will be made with status code 302"
    ["isMet":"Madewithlove\ResultLine":private]=> bool(true)
    ["isValid":"Madewithlove\ResultLine":private]=> bool(true)
    ["wasReached":"Madewithlove\ResultLine":private]=> bool(true)
  }
}
*/
```

### Server variables

[](#server-variables)

Htaccess Tester supports passing server variables to be evaluated by the rewrite rules. We currently support the following variables.

Server variables can be passed to the `test()` and `share()` methods.

```
$serverVariables = ServerVariables::default()->with(
    'SERVER_NAME',
    'example.com'
);

$response = $client->test(
    'http://localhost',
    'RewriteCond %{SERVER_NAME} example.com
    RewriteRule .* /foo [R]',
    $serverVariables
);

$response = $client->share(
    'http://localhost',
    'RewriteCond %{SERVER_NAME} example.com
    RewriteRule .* /foo [R]',
    $serverVariables
);
```

###  Health Score

60

—

FairBetter than 98% of packages

Maintenance86

Actively maintained with recent releases

Popularity35

Limited adoption so far

Community21

Small or concentrated contributor base

Maturity84

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 70.1% 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 ~177 days

Recently: every ~406 days

Total

14

Last Release

106d ago

Major Versions

v1.6.1 → v2.02021-10-08

v2.3.0 → v3.0.02026-03-20

PHP version history (4 changes)v1.1.0PHP ^7.2

v1.5.0PHP ^7.3|^8.0

v2.0PHP ^8.0

v3.0.0PHP ^8.4

### Community

Maintainers

![](https://www.gravatar.com/avatar/df052a58ecfa5a07fd2b4cb12bb128ab28ff4b8e82fb0831eab81623b898ddb4?d=identicon)[madewithlove-machine-user](/maintainers/madewithlove-machine-user)

![](https://www.gravatar.com/avatar/47020dbad12c7484fcbf5d489573b7d67a3a9f479d7b3f47b314e8bf4372aab5?d=identicon)[WouterSioen](/maintainers/WouterSioen)

---

Top Contributors

[![WouterSioen](https://avatars.githubusercontent.com/u/1398405?v=4)](https://github.com/WouterSioen "WouterSioen (150 commits)")[![jdrieghe](https://avatars.githubusercontent.com/u/12606789?v=4)](https://github.com/jdrieghe "jdrieghe (52 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (4 commits)")[![dependabot-preview[bot]](https://avatars.githubusercontent.com/in/2141?v=4)](https://github.com/dependabot-preview[bot] "dependabot-preview[bot] (4 commits)")[![madewithlove-machine-user](https://avatars.githubusercontent.com/u/23337192?v=4)](https://github.com/madewithlove-machine-user "madewithlove-machine-user (4 commits)")

---

Tags

hacktoberfestphp

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/madewithlove-htaccess-api-client/health.svg)

```
[![Health](https://phpackages.com/badges/madewithlove-htaccess-api-client/health.svg)](https://phpackages.com/packages/madewithlove-htaccess-api-client)
```

###  Alternatives

[tempest/framework

The PHP framework that gets out of your way.

2.2k34.4k15](/packages/tempest-framework)[mollie/mollie-api-php

Mollie API client library for PHP. Mollie is a European Payment Service provider and offers international payment methods such as Mastercard, VISA, American Express and PayPal, and local payment methods such as iDEAL, Bancontact, SOFORT Banking, SEPA direct debit, Belfius Direct Net, KBC Payment Button and various gift cards such as Podiumcadeaukaart and fashioncheque.

60216.0M85](/packages/mollie-mollie-api-php)[flow-php/flow

PHP ETL - Extract Transform Load - Data processing framework

85036.3k](/packages/flow-php-flow)[getbrevo/brevo-php

Official Brevo provided RESTFul API V3 php library

1003.9M50](/packages/getbrevo-brevo-php)[drupal/core-recommended

Locked core dependencies; require this project INSTEAD OF drupal/core.

6942.5M420](/packages/drupal-core-recommended)[telnyx/telnyx-php

Official Telnyx PHP SDK — APIs for Voice, SMS, MMS, WhatsApp, Fax, SIP Trunking, Wireless IoT, Call Control, and more. Build global communications on Telnyx's private carrier-grade network.

35789.4k2](/packages/telnyx-telnyx-php)

PHPackages © 2026

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