> Easily test your redirection plan.
npm install @studiometa/cli-test-redirection> Easily test your redirection plan.
You can directly use the CLI with docker:
``sh`
docker run -it --rm -v $PWD:/app studiometa/test-redirection redirects.csv
Or with npx:
`sh`
npx @studiometa/cli-test-redirection redirects.csv
Or you can install it globally:
`sh`
npm install -g @studiometa/cli-test-redirection
test-redirection redirects.csv
The redirects.csv file should have 2 columns: the first one is the original URL, the second is the redirected URL.
The Docker image can configure an Apache environment to test request against a mocked environment.
`shCreate your .htaccess file with redirections to test
vim .htaccess
Parameters
$3
Limit the number of tests running concurrently.
`bash
Limit to 1 test
test-redirection --concurrency 1 path/to/redirects.csv
test-redirection -c 1 path/to/redirects.csv
`$3
Add a delay in milliseconds between batch of tests.
`bash
Wait for 1s between each batch of tests
test-redirection --delay 1000 path/to/redirects.csv
test-redirection -d 1000 path/to/redirects.csvWait for 1s between each tests
test-redirection --delay 1000 --concurrency 1 path/to/redirects.csv
test-redirection -d 1000 -c 1 path/to/redirects.csv
`$3
Ignore query parameters when comparing the final URL with the target URL defined in the config.
`bash
test-redirection --ignore-query-parameters path/to/config.json
`$3
Define how the input file should be parsed. The parser is inferred by the given file extension.
`bash
test-redirection path/to/file.csv --parser csv
`$3
Replace the host from the values in the configuration file to easily test against different environment.
`bash
test-redirection path/to/config.json --replace-host preprod.fqdn.com
`$3
Display verbose output.
`bash
test-redirection path/to/config.json -v
`$3
When in verbose mode, will only print errors to the console. Useful when you have hundreds of redirections with only a few one failing.
`bash
test-redirection path/to/config.json -v --only-errors
`$3
Define basic auth user. This parameter is directly passed to the underlying
curl command.`bash
test-redirection path/to/config.json --user user:password
``