Sign inSign up

madewithlove/htaccess-cli

By madewithlove

•Updated 7 months ago

CLI tool for the best htaccess tester in the world.

Image
0

1.1K

madewithlove/htaccess-cli repository overview

⁠htaccess CLI

A CLI tool to test how .htaccess files behave

⁠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.

⁠Usage

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.

Screenshot 2019-11-21 at 12 28 53

⁠Usage through Docker
# 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>
⁠CLI 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
⁠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.

Tag summary

Content type

Image

Digest

sha256:e736c1286…

Size

44.4 MB

Last updated

7 months ago

docker pull madewithlove/htaccess-cli