CLI tool for the best htaccess tester in the world.
1.1K
A CLI tool to test how .htaccess files behave
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.
If your .htaccess file lives in your root directory, you can run the cli tool using
htaccess http://localhost/foo
Where the url is the request url you want to test your .htaccess file with.

# install the container
docker pull madewithlove/htaccess-cli:latest
# run the htaccess tester in the current folder
docker run --rm -v $PWD:/app madewithlove/htaccess-cli [url] <options>
The following options are available:
-r, --referrer[=REFERRER] The referrer header, used as HTTP_REFERER 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
-h, --help Display a help message
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.
Content type
Image
Digest
sha256:e736c1286…
Size
44.4 MB
Last updated
7 months ago
docker pull madewithlove/htaccess-cli