DEV Community

Cover image for RedirectConverter: Stop Hand-Translating Redirects Between Platforms
Dev Encyclopedia
Dev Encyclopedia

Posted on • Originally published at devencyclopedia.com

RedirectConverter: Stop Hand-Translating Redirects Between Platforms

If you've ever migrated a Next.js project to Vercel, Netlify, or a Nitro-based framework like TanStack Start or Nuxt, you've probably hit this problem: your next.config.js redirects, headers, and rewrites don't just copy-paste over. Each platform has its own syntax, its own path pattern conventions, and its own quirks around conditional matching.

I built RedirectConverter to fix that.

What it does

Paste your next.config.js redirects, headers, or rewrites block, pick a target format, and get back the equivalent config for:

  • netlify.toml (Netlify)
  • vercel.json (Vercel)
  • nitro.config.ts (Nitro — TanStack Start, Nuxt)

How it works

  1. Paste your config — the full async redirects() { return [...] } function or just the array
  2. Select rule type — Redirects, Headers, or Rewrites (or auto-detect)
  3. Pick your target format
  4. The parser extracts your rules — a restricted object literal parser (no eval) handles unquoted keys, single quotes, comments, and trailing commas
  5. Path patterns get translated:path* becomes :splat for Netlify or ** for Nitro, named params are preserved where supported
  6. You get the output, a per-rule mapping table, and warnings for anything that doesn't convert cleanly

The tricky part: conditional redirects

Next.js supports has/missing conditions (matching by header, cookie, or query param). Vercel supports these natively since it shares Next.js's redirect format, but Netlify and Nitro don't. RedirectConverter flags every rule using conditions so you know exactly what needs manual review instead of silently dropping behavior.

Privacy

Everything runs client-side in plain JavaScript. No backend, no API calls, nothing leaves your browser, and it even works offline once the page loads.

🔗 Try it: https://devencyclopedia.com/tools/redirectconverter


Would love feedback if you try it on a real migration, especially edge cases in your redirect rules that don't map cleanly.

Top comments (0)