.htaccess Generator
Build an .htaccess configuration file by toggling sections and setting values. The generated output updates in real-time as you configure each option.
What is an .htaccess file?
.htaccess (Hypertext Access) is a configuration file used by Apache web servers to control directory-level settings. It allows you to manage URL redirects, access control, authentication, caching, compression, and security headers without modifying the main server configuration. Place the generated file in your website's root directory to apply the rules.
.htaccess is a per-directory Apache configuration file — directives apply to the directory and all subdirectories
mod_rewrite enables URL rewriting — used for HTTPS redirects, www normalization, and clean URLs
mod_headers sets HTTP response headers — security headers, caching, CORS, and content-type options
mod_deflate enables GZIP compression for text-based resources — reduces transfer size by 60-80%
Deny/Allow rules, IP blocking, file type restrictions, and hotlink protection via Referer checking
Spec: Apache HTTP Server Documentation, mod_rewrite, mod_headers, mod_deflate