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(2mo ago)930.3k↓47.9%11GPL-3.0-or-laterPHPPHP ^8.4

Since Nov 20Pushed 1y ago9 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 1mo ago

READMEChangelog (6)Dependencies (15)Versions (19)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

53

—

FairBetter than 97% of packages

Maintenance57

Moderate activity, may be stable

Popularity34

Limited adoption so far

Community21

Small or concentrated contributor base

Maturity83

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 70.9% 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

60d 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 (146 commits)")[![jdrieghe](https://avatars.githubusercontent.com/u/12606789?v=4)](https://github.com/jdrieghe "jdrieghe (50 commits)")[![dependabot-preview[bot]](https://avatars.githubusercontent.com/in/2141?v=4)](https://github.com/dependabot-preview[bot] "dependabot-preview[bot] (4 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (3 commits)")[![madewithlove-machine-user](https://avatars.githubusercontent.com/u/23337192?v=4)](https://github.com/madewithlove-machine-user "madewithlove-machine-user (3 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

[kbsali/redmine-api

Redmine API client

4221.1M24](/packages/kbsali-redmine-api)[getbrevo/brevo-php

Official Brevo provided RESTFul API V3 php library

963.1M35](/packages/getbrevo-brevo-php)[swisnl/json-api-client

A PHP package for mapping remote JSON:API resources to Eloquent like models and collections.

211473.2k12](/packages/swisnl-json-api-client)[wordpress/php-ai-client

A provider agnostic PHP AI client SDK to communicate with any generative AI models of various capabilities using a uniform API.

26236.6k14](/packages/wordpress-php-ai-client)[prokerala/astrology-sdk

Prokerala.com Astrology API Client Library for PHP.

2610.0k](/packages/prokerala-astrology-sdk)[luzrain/telegram-bot-api

PHP Wrapper for Telegram Bot API

1032.8k1](/packages/luzrain-telegram-bot-api)

PHPackages © 2026

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