OomTools

.htaccess Redirect Generator

Create Apache .htaccess redirect rules without memorising the syntax: redirect a single URL or a whole site to a new domain, force HTTPS, and add or remove www — with 301 or 302 status. Copy the rules straight into your .htaccess. Built in your browser.

  • 100% free
  • Private & safe
  • Runs in your browser
Read our complete guide: How to Set Up 301 Redirects in .htaccess (Cheatsheet & Examples)

Why use htaccess Redirect Generator?

htaccess Redirect Generator helps you optimise and publish with confidence, producing clean, standards-friendly output you can paste straight into your site.

  • Runs instantly in your browser — nothing to install, nothing uploaded.
  • Completely free, with no account, no watermarks and no usage limits.
  • Output: Apache mod_rewrite / Redirect directives
  • Pick a single-URL or whole-domain redirect.
  • Works on any device — desktop, tablet and phone — and is fully keyboard accessible.

How to use htaccess Redirect Generator

  1. Pick a single-URL or whole-domain redirect.
  2. Enter the from/to and choose 301 or 302.
  3. Optionally force HTTPS and set www handling.
  4. Copy the .htaccess rules.

Examples

  • 301-redirecting /old-page to a new URL.
  • Forcing HTTPS and non-www across a site.

Supported formats & limits

  • Output: Apache mod_rewrite / Redirect directives

Limitations

  • For Apache with mod_rewrite enabled; Nginx uses different syntax.
  • Test on a staging site — a bad rule can cause redirect loops.

Frequently asked questions

301 or 302?

Use 301 for permanent moves (passes SEO value) and 302 for temporary ones.

Will this work on Nginx?

No — .htaccess is Apache-specific; Nginx needs server-block rewrites.

Uploaded?

No — the rules are generated in your browser.

Was this tool helpful?

From the blog