DevToolkit

Redirect Rules Generator

Back home

Browser only

Redirect Rules Generator

Generate redirect rules for Nginx, Caddy, Apache .htaccess, Vercel, and Netlify directly in your browser.

Start with an example

This generator runs entirely in the browser and only formats the redirect snippet you ask for.

Deep dive

More context for Redirect Rules Generator

Useful when you want to turn an old path into a clean 301 or 302 redirect before you update Nginx, Caddy, Apache .htaccess, Vercel, or Netlify.

Overview

What is this tool?

It generates common redirect rules in your browser from a source path, target path or URL, redirect type, and platform-specific syntax for Nginx, Caddy, Apache .htaccess, Vercel redirects, and Netlify _redirects.

Input samples

Example inputs

Nginx exact redirect

location = /old-page {
    return 301 /new-page$is_args$args;
}

Vercel wildcard redirect

{
  "redirects": [
    {
      "source": "/blog/:path*",
      "destination": "/posts/:path*",
      "statusCode": 301
    }
  ]
}

Netlify _redirects line

/legacy/* /docs/:splat 302

When to use it

Common use cases

  • Move an old URL to a new slug during a site migration.
  • Create a 301 redirect for SEO or a 302 redirect for a temporary campaign.
  • Translate the same redirect idea into platform syntax for Nginx, Caddy, Apache, Vercel, or Netlify.

Navigation

Explore related workflows

Keep moving through the collection, workflow, and adjacent tools that usually belong with this page.

Related workflow

Continue with the tool chain that usually goes together here.

Debug website headers and CORS

Parse response headers, review security protections, generate CORS snippets, and prepare redirect rules for web apps.

Answers

FAQ

Is this a redirect tool or a rewrite tool?

It is a best-effort redirect generator. The output is meant for browser-side rule templates, not for backend rewrite logic or runtime routing.

Can it generate wildcard redirects?

Yes. Match all subpaths turns a source like `/blog/*` into a path-based redirect that carries the rest of the path to the new destination.

Does it preserve query strings?

Yes, when the selected platform supports it. On Vercel and Netlify, query strings are forwarded by default for common 301 and 302 redirects, so the generator calls that out in a warning.

Should I use 301 or 302?

Use 301 for a permanent move and 302 when the redirect is temporary or still changing.

Does it change my server or test a live URL?

No. It only generates text in your browser. You still need to review rule order, matching scope, and destination behavior before you deploy it.

Disclaimer

Disclaimer / limitation note

This is a best-effort redirect rule generator, not a replacement for production review. Check rule order, matching range, canonical host behavior, and destination paths before shipping it, because a bad redirect can affect SEO, login flows, or API routes. All generation happens locally in your browser and is not uploaded to a server.

Privacy

Privacy note

Generation happens entirely in your browser. No backend request is needed, no login is required, and DevToolkit does not store the redirect rules you generate here.