PHPackages                             madewithlove/htaccess-cli - 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. madewithlove/htaccess-cli

ActivePackage

madewithlove/htaccess-cli
=========================

CLI interface for the best htaccess tester in the world.

v3.0.0(2mo ago)4329.1k↓46.8%3GPL-3.0-or-laterPHPPHP ^8.4CI passing

Since Nov 20Pushed 2mo ago9 watchersCompare

[ Source](https://github.com/madewithlove/htaccess-cli)[ Packagist](https://packagist.org/packages/madewithlove/htaccess-cli)[ RSS](/packages/madewithlove-htaccess-cli/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (4)Dependencies (14)Versions (29)Used By (0)

htaccess CLI
============

[](#htaccess-cli)

[![Build status](https://github.com/madewithlove/htaccess-cli/workflows/Continious%20Integration/badge.svg)](https://github.com/madewithlove/htaccess-cli/actions?query=branch%3Amain)[![Latest Stable Version](https://camo.githubusercontent.com/36a3260479b96d05554ed6487dc9e88bb17b9a78770f70cde1c500a0ee4e5632/68747470733a2f2f706f7365722e707567782e6f72672f6d616465776974686c6f76652f68746163636573732d636c692f76657273696f6e)](https://packagist.org/packages/madewithlove/htaccess-cli)[![License](https://camo.githubusercontent.com/c09c63b5aff283f23c02fac41acf180c2aee87a711ff536b41eef82faac5113a/68747470733a2f2f706f7365722e707567782e6f72672f6d616465776974686c6f76652f68746163636573732d636c692f6c6963656e7365)](https://packagist.org/packages/madewithlove/htaccess-cli)[![codecov](https://camo.githubusercontent.com/383b7ae5884a78fc591c95d081cc0baac6beec1236ce1a38ea6a9c0ec0557116/68747470733a2f2f636f6465636f762e696f2f67682f6d616465776974686c6f76652f68746163636573732d636c692f6272616e63682f6d61696e2f67726170682f62616467652e737667)](https://codecov.io/gh/madewithlove/htaccess-cli)

A CLI tool to test how .htaccess files behave.

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

[](#installation)

To start performing analysis on your code, require htaccess CLI in Composer:

```
composer require --dev madewithlove/htaccess-cli
```

Composer will install htaccess-cli's executable in its bin-dir, which defaults to vendor/bin.

### Global installation

[](#global-installation)

```
composer global require madewithlove/htaccess-cli
```

Then make sure you have the global Composer binaries directory in your `PATH`. This directory is platform-dependent, see `Composer documentation `\_ for details. This allows you to use the tool as `htaccess` from every location in your system.

Usage
-----

[](#usage)

Run the .htaccess CLI tester from a directory containing a .htaccess file.

```
# using global installation
htaccess http://localhost/foo

# using project-specific installation
vendor/bin/htaccess http://localhost/foo
```

Where the url is the request url you want to test your .htaccess file with.

[![Output of the htaccess tester](https://user-images.githubusercontent.com/1398405/70325684-d8072600-1832-11ea-99f2-3182c0ac3906.png)](https://user-images.githubusercontent.com/1398405/70325684-d8072600-1832-11ea-99f2-3182c0ac3906.png)

### Usage through Docker

[](#usage-through-docker)

```
# install the container
docker pull madewithlove/htaccess-cli

# run the htaccess tester in the current folder
docker run --rm -v $PWD:/app madewithlove/htaccess-cli [url]
```

### Usage as a GitHub Action

[](#usage-as-a-github-action)

Check  if you want to verify how .htaccess files behave in a GitHub Action.

CLI Options
-----------

[](#cli-options)

The following options are available:

```
-r, --referrer[=REFERRER]           The referrer header, used as HTTP_REFERER in apache
--http-user-agent[=HTTP_USER_AGENT] The User Agent header, used as HTTP_USER_AGENT in apache
-s, --server-name[=SERVER-NAME]     The configured server name, used as SERVER_NAME in apache
-e, --expected-url[=EXPECTED-URL]   When configured, errors when the output url does not equal this url
    --share                         When passed, you'll receive a share url for your test run
-l, --url-list[=URL-LIST]           Location of the yaml file containing your url list
-p, --path[=WORKING_DIR]            Path to the location of the .htaccess file you wish to test
-h, --help                          Display a help message

```

Usages with multiple url's
--------------------------

[](#usages-with-multiple-urls)

To test one htaccess file with multiple url's, you can use a yaml file that contains them.

```
- http://localhost/foo
- http://localhost/bar
```

If you want to pass an expected url for every url you're testing, you can use this yaml structure, where each url maps to an expected url.

```
http://localhost/foo: http://localhost/test
http://localhost/bar: http://localhost/test
```

You can then run the command using

```
htaccess --url-list ./url-list.yaml
```

Testing against a working directory
-----------------------------------

[](#testing-against-a-working-directory)

If you want to test for a `.htaccess` file outside of the current working directory, you can use the `-p ./path_to_directory` option in the command. For example,

```
htaccess -p ./html http://localhost/
```

### Note

[](#note)

The tool simulates only one pass through the server, while Apache will do multiple if you get back on the same domain. This is a feature we might still add in the future, but it's a limitation for now.

###  Health Score

62

—

FairBetter than 99% of packages

Maintenance88

Actively maintained with recent releases

Popularity39

Limited adoption so far

Community19

Small or concentrated contributor base

Maturity85

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 76.2% 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 ~92 days

Recently: every ~484 days

Total

26

Last Release

60d ago

Major Versions

v1.11.0 → v2.02021-10-08

v2.0.1 → v3.0.02026-03-20

PHP version history (3 changes)v1.9.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 (199 commits)")[![jdrieghe](https://avatars.githubusercontent.com/u/12606789?v=4)](https://github.com/jdrieghe "jdrieghe (47 commits)")[![staticred](https://avatars.githubusercontent.com/u/867934?v=4)](https://github.com/staticred "staticred (7 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 (1 commits)")

---

Tags

hacktoberfest

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

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

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

###  Alternatives

[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.4k5.6M651](/packages/sylius-sylius)[behat/behat

Scenario-oriented BDD framework for PHP

4.0k96.8M2.0k](/packages/behat-behat)[sulu/sulu

Core framework that implements the functionality of the Sulu content management system

1.3k1.3M152](/packages/sulu-sulu)[prestashop/prestashop

PrestaShop is an Open Source e-commerce platform, committed to providing the best shopping cart experience for both merchants and customers.

9.0k15.4k](/packages/prestashop-prestashop)[open-dxp/opendxp

Content &amp; Product Management Framework (CMS/PIM)

7310.3k29](/packages/open-dxp-opendxp)[aeliot/todo-registrar

Register TODOs from source code in issue tracker

153.0k](/packages/aeliot-todo-registrar)

PHPackages © 2026

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