.htaccess Generator

Redirect, HTTPS, www and folder rules for your .htaccess file, ready to paste.

Was this tool helpful?

.htaccess Generator – Redirects and Rules for Apache

The .htaccess generator writes Apache rules for redirects, HTTPS, www or non-www, folder moves and trailing slashes, ready to paste into the .htaccess file in your site’s root folder.

.htaccess Generator on ToolForSEO

Every rule is explained, and lines that look wrong get a warning before you paste them.

How to use the .htaccess Generator

  1. Choose the kind of rule you need.
  2. Fill in the old and new addresses or domains.
  3. Copy the code.
  4. Back up .htaccess, paste the rules above the WordPress block and test.

.htaccess Generator features

  • Common rules HTTPS, www, folders and single pages.
  • Safe placement Shows where to paste in WordPress.
  • Checks Warns about missing targets and odd lines.
  • Nginx too The same rules for Nginx servers.

Who uses the .htaccess Generator

WordPress users, developers and SEOs on Apache or LiteSpeed hosting use it for redirects and HTTPS.

Where is the .htaccess file?

In the root folder of your site (public_html), next to wp-config.php. It is hidden, so turn on “show hidden files” in your file manager.

LiteSpeed reads .htaccess too

Most cheap and fast hosts use LiteSpeed, which follows the same .htaccess rules as Apache.

.htaccess Generator at a glance

  • Price Free, no limit
  • Works In your browser – nothing is uploaded
  • Account Not needed
  • Devices Phone, tablet and computer

Tip

Always keep a copy of the working .htaccess. One typo can show a 500 error; pasting the old copy back fixes it.

Frequently asked questions

Will this work on Nginx?

No, Nginx does not read .htaccess. Use the Nginx code the tool also gives you.

Where in the file do rules go?

Above the “# BEGIN WordPress” block.

Do I need mod_rewrite?

Yes, it is on at almost every Apache host.

Is the .htaccess Generator free?

Yes. The .htaccess Generator is free with no limit, because it runs in your browser. Your data never leaves your device and you do not need an account.

Is my text or data uploaded?

No. The .htaccess Generator runs completely in your browser, so nothing you type or paste is sent to our server or stored anywhere.

Related tools

Scroll to Top