Skip to content
M2TOOLKIT

.htaccess Generator

Build common Apache rewrite and header rules without memorising the syntax.

  • Free
  • No sign-up
  • Runs in your browser
A mistake in .htaccess can take a site offline with a 500 error. Keep a backup of your current file and test on staging first.

Everything you type is processed in your browser. Nothing you enter is sent to our servers or stored by us.

How to use the .htaccess Generator

  1. Tick the features you need.
  2. Add redirects as “from to” pairs.
  3. Copy the file to your site's root folder — after backing up the old one.

What does this tool do?

.htaccess files configure Apache and LiteSpeed hosting (common on shared hosts and WordPress). Rules are wrapped in IfModule checks so missing modules don't break the site, and sensitive files like .env and .git are blocked when security headers are on. Test on a staging site first.

Everything runs in your browser — nothing you paste is uploaded.

Why use it?

  • HTTPS and www rules.
  • Bulk redirects.
  • Caching and security headers.

Privacy

Everything you type is processed in your browser. Nothing you enter is sent to our servers or stored by us. There's no account to create and nothing to install.

Last reviewed by the M2Toolkit team.

Other tools people use alongside the .htaccess generator.