Free · in your browser

.htaccess Redirect Generator

Build clean Apache 301 and 302 redirect rules from old paths to new URLs — copy-and-paste ready. Free, instant and private: your data never leaves your device.

Private by design — your paths and URLs are processed locally and never uploaded.

How to generate .htaccess redirect rules

  1. Enter the old path (e.g. /old-page) and the new URL (e.g. https://example.com/new-page) for each move. Click + Add row for more.
  2. Choose the redirect type — 301 permanent or 302 temporary — and the directive style (Redirect or RewriteRule).
  3. Click Generate rules, then Copy the output and paste it into the .htaccess file in your site root.

Why use a redirect generator?

When you rename pages, restructure a site, or move to a new domain, broken URLs cost you traffic and rankings. Apache redirects send both visitors and search engines to the right place, and a 301 passes most of the old page's link equity to the new one. Hand-writing .htaccess rules is error-prone — a single stray space or missing scheme can break your whole site. This generator produces correctly formatted, copy-ready Redirect and RewriteRule lines in seconds, so your migrations stay clean and your SEO stays intact.

Frequently asked questions

Is this .htaccess redirect generator free and private?
Yes — it is 100% free with no sign-up, and completely private. Your paths and URLs are turned into Apache redirect rules entirely in your browser; nothing is ever uploaded to a server.
What is the difference between a 301 and a 302 redirect?
A 301 is a permanent redirect — it tells search engines the page has moved for good and passes ranking signals to the new URL. A 302 is temporary, signalling the move is short-lived, so the original URL keeps its ranking. Use 301 for permanent moves and 302 for short-term changes.
Where do I put the generated rules?
Paste the generated lines into the .htaccess file in your site root (or the relevant directory). Apache reads them on the next request — no restart needed. Make a backup of your existing .htaccess first.
Does it use Redirect or RewriteRule?
For simple path-to-URL moves it outputs mod_alias Redirect directives, which are the cleanest. You can switch to mod_rewrite RewriteRule output if you prefer or if mod_alias is unavailable on your host.

JSON Formatter →   Base64 Encoder / Decoder →   All tools →