Module-safe blocks
Optional compression, cache, header, and MIME directives are guarded with IfModule where appropriate.
Build redirect, performance, security, access-control, and error-handling rules with validation and server-compatibility guidance.
Optional compression, cache, header, and MIME directives are guarded with IfModule where appropriate.
Domains, paths, redirects, IP entries, and numeric PHP limits are checked before output is created.
The builder flags HSTS, PHP-FPM, custom directives, and host-level restrictions that require extra care.
This file is read by Apache for the directory where it lives and usually its descendants. Hosting providers can disable individual directives or .htaccess overrides entirely.
Rename or download the existing file before replacement. If the site returns HTTP 500, restore it immediately.
Canonical hostname and HTTPS rules are combined here when both are enabled, reducing unnecessary redirect hops.
Browsers remember it for the selected max age. Do not enable it until HTTPS works for every required hostname.
Nginx, IIS, Caddy, and many managed platforms do not use .htaccess. Their configuration syntax is different.