Htaccess Toolkit
/install htaccess-toolkit
htaccess Toolkit
Generate, validate, lint, and explain Apache .htaccess files with security headers, caching, CORS, compression, and more.
Generate
# HTTPS redirect + security headers + compression
python3 scripts/htaccess.py generate --rewrites http-to-https --security strict --compression
# Full production setup
python3 scripts/htaccess.py generate \
--rewrites http-to-https www-to-non-www \
--security strict \
--caching standard \
--compression \
--protect directory-listing dotfiles sensitive-files \
--error-pages 404 500 \
-o .htaccess
# WordPress hardening
python3 scripts/htaccess.py generate --protect wp-config xmlrpc dotfiles --security strict
# CORS for specific domain
python3 scripts/htaccess.py generate --cors specific --domain example.com
# Custom redirects
python3 scripts/htaccess.py generate --redirects "/old-page -> /new-page" "/blog -> https://blog.example.com"
# Hotlinking protection
python3 scripts/htaccess.py generate --protect hotlinking --domain example.com
Lint
# Basic lint
python3 scripts/htaccess.py lint .htaccess
# Strict mode (exit 1 on errors, CI-friendly)
python3 scripts/htaccess.py lint .htaccess --strict
# Filter by severity
python3 scripts/htaccess.py lint .htaccess --severity error warning
# JSON output
python3 scripts/htaccess.py lint .htaccess -f json
Lint Checks (10 rules)
rewrite-no-engine— RewriteRule without RewriteEngine Onduplicate-rewrite-engine— Multiple RewriteEngine Onredirect-no-slash— Redirect path not starting with /missing-l-flag— RewriteRule without [L] flagmixed-redirect-rewrite— Mixing Redirect and RewriteRuleunclosed-ifmodule— Unclosed IfModule blocksunclosed-files— Unclosed Files/FilesMatch blockswildcard-cors— Wildcard origin with credentialsno-hsts— HTTPS without HSTS headeroptions-minus-indexes— Directory listing not disabled
Explain
# Human-readable explanation of each directive
python3 scripts/htaccess.py explain .htaccess
List Presets
python3 scripts/htaccess.py presets
python3 scripts/htaccess.py presets -f json
Available Presets
Rewrites: http-to-https, www-to-non-www, non-www-to-www, trailing-slash-add, trailing-slash-remove, remove-extension
Security: basic, strict
Caching: standard, aggressive
CORS: permissive, specific
Protection: directory-listing, dotfiles, sensitive-files, wp-config, xmlrpc, hotlinking
Error Pages: 404, 403, 500, 503
- Make sure OpenClaw is installed (local or Docker)
- Run the install command in chat:
/install htaccess-toolkit - After installation, invoke the skill by name or use
/htaccess-toolkit - Provide required inputs per the skill's parameter spec and get structured output
What is Htaccess Toolkit?
Generate, validate, lint, and explain Apache .htaccess files. Use when asked to create htaccess rules, redirect URLs, set security headers, enable caching, c... It is an AI Agent Skill for Claude Code / OpenClaw, with 96 downloads so far.
How do I install Htaccess Toolkit?
Run "/install htaccess-toolkit" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.
Is Htaccess Toolkit free?
Yes, Htaccess Toolkit is completely free, licensed under MIT-0. You can download, install and use it at no cost.
Which platforms does Htaccess Toolkit support?
Htaccess Toolkit is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).
Who created Htaccess Toolkit?
It is built and maintained by charlie-morrison (@charlie-morrison); the current version is v1.0.0.