Skip to content

.htaccess Redirect Generator

Turn a list of old and new URLs into Apache redirect rules.

Quick Tool Overview

The .htaccess Redirect Generator turns a two-column redirect map into Apache rules, as plain Redirect directives or as RewriteRule lines with the regex characters escaped. It flattens redirect chains, finds loops before you paste them, and catches the unescaped dots and question marks that quietly match more URLs than intended.

What it does
Generates Apache 301 redirect rules from a URL map
You give it
One "old URL, new URL" per line
You get back
Ready-to-paste .htaccess rules with the problems flagged
Best for
Site migrations, URL restructures and bulk redirect work
SEO Tools Free, unlimited use No sign-up Runs in your browser

About the .htaccess Redirect Generator

Paste a two-column list of old and new URLs and the generator writes the Apache rules, either as simple Redirect directives or as RewriteRule lines with the regex characters escaped. Full URLs, paths and mixed input all work.

The checks matter more than the syntax. A redirect chain — A to B, and B to C — costs a hop and loses a little of the signal at every step, so the tool flattens them and tells you it did. A redirect loop takes a page down entirely, and those are found before you paste rather than after. Unescaped dots and question marks in a RewriteRule pattern quietly match more URLs than intended, and a rule redirecting a path to itself is an infinite loop Apache will happily serve until the browser gives up. Every one of those is checked here.

Key features of the .htaccess Redirect Generator

Chains flattened

A to B and B to C becomes A to C, because every extra hop loses a little and Google stops following after about five.

Loops caught

A redirect that points back at itself takes a page down completely. Those are found before the file ships.

Regex characters escaped

An unescaped dot in a RewriteRule matches any character, which is how one rule ends up redirecting ten pages.

Redirect or RewriteRule

Both are generated from the same map, so you can compare them and take whichever fits.

Placement guidance

It says where in the file the rules go, since anything after a framework block is never reached.

How to use the .htaccess Redirect Generator

  1. 1

    Paste your redirect map

    One per line as "old URL, new URL" — commas, tabs or pipes all work.

  2. 2

    Choose the rule type

    Redirect for simple path swaps, RewriteRule when you need patterns or query strings.

  3. 3

    Read the warnings

    Chains, loops, duplicates and unescaped regex characters are all flagged.

  4. 4

    Paste into .htaccess

    Put the rules near the top of the file, above any framework rewrite block.

Frequently asked questions

Redirect is simpler and enough for a plain path-to-path move. RewriteRule is needed when you want to match a pattern, handle query strings, or apply a condition. This tool writes either, and defaults to Redirect because most redirect maps do not need more.

Reviews of the .htaccess Redirect Generator

What people who use the .htaccess Redirect Generator think of it. Reviews come from visitors and are posted as written.

No ratings yet

Yours would be the first.

  • 5 0 reviews rated 5 stars
  • 4 0 reviews rated 4 stars
  • 3 0 reviews rated 3 stars
  • 2 0 reviews rated 2 stars
  • 1 0 reviews rated 1 star

Write a review

Used this tool? Your rating helps the next person decide.

Your rating

Plain text only — links, email addresses and HTML are not accepted. Your name and review are shown publicly; nothing else is collected. See the privacy policy.

0 reviews

Newest first

No reviews yet

Be the first to rate the .htaccess Redirect Generator. It takes half a minute and no account.

Write the first review

More SEO tools