Free SEO audit with 10 action points - $2K worth of value
Rasesh Koirala

Htaccess Redirect Generator

Turn a list of old and new URLs into clean 301 redirect rules for Apache or Nginx, with redirect chains flagged.

.htaccess

How to use it

  1. Choose the output format for your server - Apache Redirect 301, Apache RewriteRule, or Nginx.
  2. Paste your old and new URLs, one pair per line. Full URLs or paths both work; the old side is reduced to a path.
  3. Check the warnings - the tool flags redirect chains and loops, which quietly waste crawl budget and slow users down.
  4. Copy the rules into your .htaccess (or server config) and test a few before going live.

What it does, and what it does not

It does: turn a list of old and new URLs into clean permanent (301) redirect rules for Apache or Nginx, and detect two costly mistakes - redirect chains (A goes to B which goes to C) and loops (A goes to A).

It does not: apply the redirects for you, or handle complex pattern-based rewrites. It is built for the common case: mapping specific old URLs to specific new ones during a migration or cleanup.

Reference

When you move or rename a page, a 301 redirect sends both users and search engines from the old URL to the new one and passes on the ranking signals the old URL had earned. Getting redirects right is the difference between a migration that holds its traffic and one that loses it. This tool builds the rules; you place them on your server.

A 301 means "moved permanently" and is what you want for almost every SEO redirect - it consolidates the old page into the new one. Use a 302 only for genuinely temporary moves. On Apache, the simplest form is Redirect 301 /old /new in your .htaccess; for anything involving patterns you would use RewriteRule. On Nginx it is a rewrite ... permanent; directive in the server block. This tool writes whichever you choose.

The mistake that hurts most is the redirect chain: over years of changes, /a redirects to /b, which now redirects to /c. Each hop adds latency and bleeds a little authority, and Google may stop following long chains. The fix is to always point every old URL straight at the final destination, so when you add a new redirect, update the older ones that fed into the old target. This tool flags chains and loops so you can flatten them before they ship. A few more habits: redirect to the closest equivalent page rather than dumping everything on the homepage, which Google treats as a soft 404; keep the rules in a sensible order; and after deploying, spot-check important URLs with a redirect checker to confirm a single 301 hop with no chain.

Questions

301 or 302?

Use 301 (permanent) for almost all SEO redirects - it consolidates the old page into the new and passes ranking signals. Use 302 only for genuinely temporary moves.

What is a redirect chain and why does it matter?

When A redirects to B which redirects to C. Each hop adds delay and loses a little authority, and Google may stop following long chains. Always point the old URL at the final destination. This tool flags chains for you.

Should I redirect everything to my homepage?

No. Redirect each old URL to its closest equivalent page. Mass-redirecting to the homepage is treated by Google as a soft 404 and passes little value.

Does this edit my server?

No. It generates the rules in your browser. You copy them into your .htaccess or server config yourself, then test.

Apache or Nginx?

Pick the format matching your web server. .htaccess is Apache; the rewrite ... permanent; format is Nginx. If unsure, ask your host.

Related tools

Built by , SEO consultant and trainer in Sydney. Found a bug or want a tool added? Tell me.