.htaccess Generator

Generate .htaccess rules for HTTPS, www or non-www redirects, a custom 404 page, compression and directory listing.

How to use .htaccess Generator

  1. Tick the options you need and enter your domain if choosing www.
  2. Copy the rules.
  3. Back up your current .htaccess, then add the rules and test every redirect.

Supported features and limitations

For Apache and LiteSpeed servers such as most shared hosting. A wrong .htaccess can take a site offline, so keep a backup. Rules are a starting point, not a substitute for testing.

Privacy

Everything you type is processed locally in your browser and is not sent to our servers. No account is needed and there is no watermark.

Frequently asked questions

Is this for WordPress?

WordPress adds its own block to .htaccess; place these rules above it.

Does it work on Nginx?

No. Nginx uses a different configuration format.

Related tools

More Developer & Webmaster Tools · All free tools