.htaccess Rule Generator
Generate a ready-to-use Apache .htaccess snippet by toggling common rules: force HTTPS, www/non-www canonicalization, disable directory listing, block sensitive files, prevent image hotlinking, a custom 404 page, gzip compression and browser caching.
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
Force HTTPS (redirect HTTP → HTTPS)
www canonicalization
none, non-www, www Disable directory browsing (Options -Indexes)
Deny access to sensitive files (.env, .git, .htaccess…)
Prevent image hotlinking
Allowed domain
Custom 404 error page
404 page path
Enable GZIP compression
Enable browser caching (Expires headers)
Cache lifetime (days)
1 <= x <= 365Response
Tool output
The tool's slug, echoing the {slug} in the request path.
Output-contract version for this tool.
Credits this call consumed, after any settlement refund. 0 when metering is disabled.
Credits left in the current monthly allowance, or null when metering is disabled.
Correlation id, also sent as x-request-id.