301

Redirect Rule Generator

Generate Nginx and Apache redirect rules

SEO & Schema
🔒 100% client-side — your data never leaves this page
Maintained by Evan•Updated: September 29, 2026
Options
Redirect Input

Fill the source, destination, and status code first to generate the redirect rule; scenario comparisons are available in Advanced mode.

Rules
Redirect rules will appear here
🔒 Processed locally in your browser
Page reading mode

The full guide also includes pitfalls, worked examples, snippets, FAQs, and related tools for checking results or troubleshooting.

About this tool

Generate one redirect mapping in Nginx, Apache and Vercel configuration formats. Nginx uses an exact location; Apache Redirect uses path-prefix matching. The Vercel object expresses permanence, so it maps permanent moves to 308 and temporary moves to 307 rather than preserving every selected HTTP code. Review each server’s path matching and query handling before deployment; this tool does not test live redirects.

Production Snippets

One mapping has different platform semantics

text

From: /old
To: /new
Code: 301

Nginx: location = /old { return 301 /new; }
Apache: Redirect 301 /old /new
Vercel: {"source":"/old","destination":"/new","permanent":true}

Nginx matches /old exactly; Apache can also match descendants. Vercel permanence produces a 308 response. Check behavior on the server you use.

Frequently Asked Questions

Do all three outputs behave identically?

No. Nginx location = matches one path, Apache Redirect can match a path prefix and append the remaining suffix, and Vercel uses its routing syntax. One source path does not imply identical matching across platforms.

How does the status code affect Vercel output?

Its permanent flag is true for selected 301 or 308, otherwise false. Vercel uses 308 for permanent and 307 for temporary redirects. The Nginx and Apache snippets retain the selected numeric code.

When does preserving the HTTP method matter?

307 and 308 preserve the request method and body. Clients may turn a POST into GET after 301 or 302. Select according to the application behavior, not only whether a move is permanent.

Can I paste arbitrary paths or migrate a list of URLs?

The form generates one mapping. It does not escape or validate Nginx/Apache configuration syntax, resolve redirect loops or migrate a batch. Use simple reviewed path values and test query strings and trailing slashes on the target server.

Keep browsing