Apache

.htaccess Generator

Toggle the rules you need, HTTPS, www, redirects, caching, compression, and get a clean, commented Apache .htaccess file. Built in your browser.

Redirect all http traffic to https.

WWW

Compress text, CSS, JS, JSON, SVG.

Far-future expiry for images, fonts, CSS, JS.

Stop Apache listing folder contents.

301/302 redirects, one per line: /old /new [301|302]
your .htaccess

A correct .htaccess without the guesswork

The Apache .htaccess file controls redirects, HTTPS, caching, and access rules per-directory, and a single misplaced RewriteRule can take a site down. This generator assembles the common rules from toggles into one clean, commented file, in the right order, with the mod_rewrite and mod_headers blocks set up correctly.

What it can build

FAQ

Where does the file go?

In the directory you want it to govern, usually your site root. Rules cascade to subdirectories unless overridden. Apache must have AllowOverride enabled for it to take effect.

301 or 302?

301 is permanent, use it when a URL has moved for good, so search engines transfer ranking. 302 is temporary. Default here is 301.

Is anything uploaded?

No, the file is generated in your browser from your toggles. Nothing is sent anywhere.

Related

Building redirect patterns? The case converter helps slug URLs; test JSON configs with JSON → TypeScript.