Redirect Rule Generator
Generate redirect rules for Apache, Nginx, Next.js, Vercel, Netlify, and Cloudflare
About this ToolHow it works, benefits & use casesTap to collapse
The Redirect Rule Generator turns a list of from/to mappings into ready-to-deploy redirect configuration for six platforms: Apache (.htaccess), Nginx (nginx.conf), Next.js (next.config.js), Vercel (vercel.json), Netlify (_redirects), and Cloudflare Pages (_redirects). Add as many rules as you need, each with a source path, a destination, and a redirect type — 301, 302, 303, 307, or 308 — with an inline description of what each status code means and when to use it. Common-pattern chips drop in frequently-needed rules like HTTP-to-HTTPS, www/non-www canonicalisation, trailing-slash handling, and stripping .html extensions, including their regex sources. Before generating, every rule is validated: empty paths, identical source and destination, and likely redirect chains are flagged as errors or warnings, and using a 302 for what looks like a permanent move prompts a 301 suggestion. The output panel emits the file with the correct name and MIME type so you can copy or download it straight into your project.
How to Use
- 1Select your Server / Platform (Vercel, Netlify, Next.js, Apache, Nginx, or Cloudflare Pages).
- 2Optionally click a Common patterns chip to append a ready-made rule such as HTTP to HTTPS or WWW to Non-WWW.
- 3Fill each rule’s From path and To path, and choose the redirect type from the dropdown (the description updates below it).
- 4Use "Add rule" for more mappings or the trash button to remove one; "Reset all" clears everything.
- 5Press "Generate redirect rules", fix any validation errors shown on the rules, then copy or download the generated config file.
Key Benefits
- One rule set, six platform outputs: Apache, Nginx, Next.js, Vercel, Netlify, and Cloudflare
- Supports all five common redirect status codes (301, 302, 303, 307, 308) with inline guidance
- Common-pattern chips for HTTPS forcing, www canonicalisation, trailing slashes, and .html removal
- Per-rule validation catches empty paths, source-equals-destination, and probable redirect chains
- Warns when a 302 is used where a 301 would be better for SEO
- Downloads with the right file name per platform (.htaccess, nginx.conf, vercel.json, _redirects, and more)
- Rules and output persist in your browser between visits
Common Use Cases
- Migrating an old URL structure to a new one without losing SEO equity
- Generating a vercel.json or next.config.js redirects block for a deployment
- Producing an Apache .htaccess RewriteEngine block for legacy shared hosting
- Forcing HTTPS and a single canonical host across an entire site
- Building a Netlify or Cloudflare Pages _redirects file from a batch of moved pages
Platform settings
Common patterns
Redirect rules
Rule 1
Permanently moved. Best for SEO, passes PageRank.
Run to generate your redirect configuration.
Redirect best practices
- Use 301 redirects for permanently moved content
- Use 302 redirects only for temporary moves
- Avoid redirect chains (A -> B -> C)
- Update internal links instead of relying on redirects
- Test redirects before deploying to production
- Monitor redirect performance and fix slow chains
Redirect type guide
301 — Permanent Redirect
Use when permanently moving content
302 — Temporary Redirect
Use for temporary moves or A/B testing
303 — See Other
Use after POST requests
307 — Temporary Redirect (HTTP/1.1)
Similar to 302 but preserves HTTP method
308 — Permanent Redirect (HTTP/1.1)
Similar to 301 but preserves HTTP method
Was this tool helpful?
Share Your Experience
Help others discover this tool!
Related tools
- htaccess GeneratorBuild an Apache .htaccess visually — force HTTPS/www, redirects, rewrites, caching, compression, security headers — grouped into IfModule blocks with an audit
- Vercel Config GeneratorBuild vercel.json — redirects, rewrites, headers (with security quick-add), crons, regions — with live JSON, presets, and a conflict audit
- Nginx Config GeneratorBuild a complete nginx server block — HTTP/HTTPS, modern SSL+HSTS, gzip, location presets (SPA, reverse proxy, PHP) — with live output and an audit
- Text to SlugConvert text to URL-friendly slugs
- Security Headers GeneratorGenerate hardened HTTP security headers with a live A+ to F grade, then export to nginx, Apache, Caddy, Vercel, Netlify, Next.js, Express, or Cloudflare; or audit a site's existing headers
- Sitemap Priority CalculatorPaste a list of URLs and get a complete XML sitemap with priorities from a transparent, tunable model — each URL auto-classified by type & depth, with a per-row score breakdown and priority distribution analysis
Six: Apache (an .htaccess RewriteEngine block using Redirect/RedirectMatch), Nginx (rewrite rules for a server block), Next.js (an async redirects() function for next.config.js), Vercel (a vercel.json redirects array), Netlify (_redirects file lines), and Cloudflare Pages (a _redirects file). Switching the platform changes both the generated syntax and the suggested download file name.
You can pick 301, 302, 303, 307, or 308 per rule, and each has an inline description and use-case note. Note that some targets simplify: the Next.js and Vercel outputs map your choice to a permanent boolean (true for 301, otherwise false), while Netlify and Cloudflare emit the numeric status directly and Apache collapses to 301 or 302.

