StacckApp

htaccess Generator

Build an Apache .htaccess file with toggles for HTTPS redirect, www handling, gzip, browser caching, custom 404, hotlink protection, and more. 100% in your browser.

Options

WWW handling
Trailing slash

Generated .htaccess

59 lines ยท 1930 chars

About htaccess Generator

Switch on the options you need, such as forcing HTTPS, adding or removing www, enabling gzip compression, setting browser cache headers, defining a custom 404 page, or blocking hotlinked images. The tool assembles the matching Apache directives into a complete .htaccess file you can copy.

The file is built entirely in your browser, so nothing about your site configuration is uploaded. Place the generated file in the document root of an Apache server with mod_rewrite enabled to apply the rules, and review each block before deploying to a production site.

Frequently asked questions

Where do I put the .htaccess file?
Place it in the root directory of your website, or in a subdirectory if you want the rules to apply only there.
Does .htaccess work on Nginx?
No. The .htaccess format is specific to Apache; Nginx uses server-block configuration instead.
Why are my rewrite rules not working?
The server usually needs mod_rewrite enabled and AllowOverride set to permit .htaccess directives in that directory.