Free Tool · No Sign-Up

Free 301 Redirect Code Generator

Enter the old URL and the new URL. We generate the matching 301 redirect snippet for .htaccess, Nginx, Next.js, and Cloudflare — pick the one that matches your stack.

Generated Code

// next.config.ts
async redirects() {
  return [
    {
      source: "/old-page",
      destination: "/new-page",
      permanent: true,
    },
  ];
}

This checks 1 thing. HellSEO's full audit scores 24 checks across SEO, AEO, and GEO — including backlink authority and score history this page doesn't cover.

See Full Score

How It Works

Enter the old path and the new destination, then pick your platform — everything is generated locally in your browser.

Each format tab produces the exact syntax that platform expects: an Redirect 301 line for .htaccess, a location block for Nginx, a redirects() entry for next.config.ts, or a Cloudflare Bulk Redirects row.

Copy the snippet and add it to your platform's config — none of this is applied automatically, since that requires deploy access this tool doesn't have.

Who Uses This

Site migrations

Generate the redirect map entries as you move pages to new URLs, without re-deriving the syntax for each platform.

URL structure cleanup

Redirect old slugs to new ones after a rename, in the exact format your hosting expects.

Consolidating duplicate pages

301 a thin/duplicate page to the canonical one it should have been merged into.

Frequently Asked Questions

301 vs 302 — which should I use?

301 (permanent) passes link equity to the new URL and tells search engines to update their index. Use 302 (temporary) only if the move really is temporary — using 302 for a permanent change is a common mistake that delays re-indexing.

Where does the .htaccess code go?

In the .htaccess file at your site's root, on Apache-based hosting. Changes take effect immediately without a server restart.

Do Next.js redirects need a rebuild?

Yes — redirects() in next.config.ts are read at build time, so a new redirect needs a redeploy to take effect.

Can I redirect an entire path pattern, not just one URL?

Yes, but this generator produces exact-match redirects. Wildcard/pattern redirects need regex-capable config, which varies more by platform than a generic snippet can safely cover.

Is this the same as a redirect maker or builder?

Yes — generator, maker, and builder are used interchangeably for this kind of tool.

Want the full picture?

This tool checks one thing. A full HellSEO audit scores your site across SEO, AEO, and GEO — and gives you ready-to-paste fixes.

Run a Full Audit