Apache .htaccess Generator

Tick the rules you need — HTTPS, www, caching, gzip, error pages — and copy a ready .htaccess.

Frequently asked questions

Where does the .htaccess file go?

In the root directory of your Apache site (or any subdirectory to scope rules to it). Apache reads it automatically if AllowOverride is enabled.

Do the redirects require mod_rewrite?

Yes. The HTTPS and www rules use mod_rewrite, and the compression and caching blocks are wrapped in checks so they're skipped safely if a module isn't available.

Will this work on Nginx?

No — .htaccess is Apache-specific. Nginx uses its own server-block configuration instead.