Skip to content
Code Generators

301 Redirect Generator

Turns your old and new address pairs into redirect rules in three formats: .htaccess, Nginx and Next.js. The fastest way to keep your link equity through a migration.

  • Sign-in requiredMembership is free
  • Open on the Pro plan100 runs a day
  • Saved to your historyReachable from your account

Aracı çalıştırın

1 zorunlu alan · sonuç birkaç saniyede hazır

Pro pakette · günde 100 analiz

Üyelik ücretsizdir ve yarım dakika sürer. Formu şimdiden doldurabilirsiniz; giriş yaptığınızda bu sayfadan ayrılmazsınız, yazdıklarınız yerinde kalır.

What does this tool look at?

Anything that is easy to get wrong by hand, generated for you: meta tags, schema, robots.txt, sitemaps and redirect rules.

  • Separate output for .htaccess, Nginx and Next.js
  • Permanent (301) redirect rules
  • Malformed and duplicated lines flagged
  • Redirect loop detection

What this tool measures

When an address changes, every inbound link, bookmark and search result pointing at the old one lands nowhere. A 301 redirect carries that traffic to the new address and preserves most of the authority the old page accumulated over the years.

From “old | new” lines the tool produces rules in three formats: an .htaccess block for Apache, rewrite lines for Nginx, and a redirects array for next.config.ts. All three are generated at once, so you take whichever matches your stack.

Before generating, three faults are checked: the same source redirected twice (the server decides which wins), source equal to destination (an infinite loop), and a destination that is also another rule's source (a chain). Up to 500 lines per run.

How to use it

  1. 1

    Pair old addresses with new ones

    Write “/old-path | /new-path” per line. If the domain stays the same, paths are enough; when moving to another domain, write the full address as the destination.

  2. 2

    Send each page to its real equivalent

    Redirecting a hundred retired pages to the homepage is the easy route and the damaging one. Google treats equivalence-free redirects as soft 404s and passes nothing on.

  3. 3

    Flatten the chains

    If A goes to B and B goes to C, point A straight at C. The audit flags this as a warning; each extra hop adds latency and spends crawl budget.

  4. 4

    Add the rules to your server

    File paths are listed below. Test the configuration before reloading: one malformed line can take the whole site offline.

  5. 5

    Verify the result one by one

    Open a few old addresses and run them through the Redirect Chain Checker: each should reach the new address in a single 301 hop. A 302 means the rule was not written as permanent.

When to use it

  • During a redesign that changes the URL structure, for example /product/123 becoming /products/red-bag.
  • When merging two pages, to carry the retired page's traffic to the survivor.
  • During a domain change, to map every path from the old domain to the new one.
  • When a campaign ends and its landing page should lead to the related category.

Reading the result

  • Apache (.htaccess)

    The block goes into .htaccess at the site root; create the file if it is missing, and make sure mod_rewrite is enabled. On WordPress the file already holds a WordPress block, and your rules must sit above it or WordPress catches the request first.

  • Nginx

    The lines belong in the server block of your configuration, usually /etc/nginx/sites-available/<site>. Run nginx -t to check syntax after saving, then reload the service. Restarting without testing can take the site down.

  • Next.js

    The array goes into the redirects function in next.config.ts, and redirects are evaluated before filesystem routes. Changes only apply after a new deploy, so test locally and then ship.

  • Duplicate source error

    When one old address points at two destinations, the server decides which wins and the outcome is unpredictable. The audit names the repeated address; delete one of the rules.

  • Self-redirect error

    A line where source equals destination creates an infinite loop and the browser reports too many redirects. Remove those lines entirely.

FAQ

Questions about the 301 Redirect Generator

Didn't find your answer?

Send us your question and we'll reply the same day.

Ask us

301 when the move is permanent, which is all this tool produces. 302 exists for temporary situations: a maintenance page, a campaign redirect for a few weeks, an A/B test. Using 302 for a permanent move delays the transfer of authority.

At least a year, ideally forever. Google eventually forgets the old address, but links on other sites and bookmarks in browsers do not. The day you remove the rule, that traffic hits a 404.

On a single, correctly built 301 the loss is negligible. Real losses come from chains, from bulk redirects to the homepage, and from destinations unrelated to the original page.

The tool reads 500 lines. Beyond that, patterns beat lists: moving every /blog/2020/* address under /blog/* in one line is faster to ship and far easier to maintain than five hundred separate rules.

The tool found the problem. Now for the fix

We run technical SEO, content and AI visibility work end to end. Let us review your site and come back with a clear list of what to do.

Monday – Saturday 09:00 – 18:00