Zero Signup ToolsFree browser tools

SEO Tools

Redirect Rule Generator

Generate 301, 302, 307, and 308 redirect rules for Apache .htaccess, Nginx, Caddy, Netlify, Vercel, Cloudflare Pages, IIS, and HTML. Free, no signup.

Redirect rule generator

Step 1

Define your redirects

Add one row per redirect. Pick the status code, the match type, and the destination. The configuration snippets below regenerate as you type.

Rule 1

Matches only the literal source path. Example: /old-page redirects /old-page exactly.

Rule 2

Matches the source path plus any path below it. Example: /blog/old/* maps to /articles/* preserving the tail.

Rule 3

Matches only the literal source path. Example: /old-page redirects /old-page exactly.

Step 2

Copy the snippet for your server

Drop into the document root or any directory. Requires mod_rewrite for prefix and regex rules.

.htaccess

3 rules included.

# Redirect rules generated by Zero Signup Tools

<IfModule mod_rewrite.c>
  RewriteEngine On
Redirect 301 /old-page /new-page
  RewriteRule ^blog/old-category(/.*)?$ /articles$1 [R=301,L]
Redirect 302 /promo https://example.com/landing
</IfModule>

Redirect status codes

Pick the right code for the situation. The wrong status can hurt SEO or break POST-based form submissions.

  • 301 Moved Permanently

    Permanent redirect. Search engines transfer ranking signals. Use for permanent URL changes and site migrations.

  • 302 Found

    Temporary redirect. Search engines keep the original URL indexed. Use for short-term A/B tests, promos, or maintenance pages.

  • 307 Temporary Redirect

    Like 302 but preserves the HTTP method and body. Use when the redirect must keep a POST as a POST.

  • 308 Permanent Redirect

    Like 301 but preserves the HTTP method and body. Use for permanent moves where method preservation matters.

How to use

  1. Add a rule. Type the old URL path in From (for example, /old-page) and the new URL or path in To (a relative path like /new-page or a full URL like https://example.com/new).
  2. Pick the status code: 301 for permanent moves (the SEO default), 302 for temporary, 307 to preserve POST method on a temporary move, or 308 for a permanent move that preserves method.
  3. Pick the match type: Exact for a single URL, Prefix to redirect a path and everything under it (the tail is preserved on the destination), or Regex for advanced patterns.
  4. Add more rules with Add another redirect. The notices panel flags missing slashes, redirect loops, and chained redirects so you can fix them before shipping.
  5. Pick your server (Apache, Nginx, Caddy, Netlify, Vercel, Cloudflare Pages, IIS, or HTML meta refresh) and click Copy snippet. Paste into the file shown in the tab description.

About this tool

Redirect Rule Generator turns a list of source-to-destination redirect rules into ready-to-paste configuration snippets for the eight places people actually ship redirects: Apache .htaccess (mod_alias Redirect for exact paths and mod_rewrite RewriteRule for prefix and regex matches), Nginx server blocks (location = for exact matches, ^~ with a rewrite for prefix moves, and location ~ for regex), Caddy (redir directive with path_regexp matchers when needed), Netlify _redirects, Vercel vercel.json (using :path* placeholders and the permanent flag for 301 and 308), Cloudflare Pages (which shares the Netlify format), IIS web.config (the URL Rewrite module with Permanent, Found, or Temporary redirectType), and a static HTML meta-refresh page with a JavaScript fallback for hosts where you cannot edit server configuration. Each rule picks its own status code (301 Moved Permanently for permanent moves so search engines transfer ranking signals, 302 Found for temporary moves like A/B tests and promos, 307 Temporary Redirect when the HTTP method and body must be preserved, and 308 Permanent Redirect when permanence and method preservation both matter) and its own match type (Exact for a single literal URL, Prefix to redirect a path and everything under it while preserving the tail, or Regex for advanced pattern matching). The tool flags common pitfalls before you ship: missing leading slashes, identical source and destination (an infinite loop), 302 codes on URLs that look like permanent moves (which dilutes ranking signals after migration), and multi-hop redirect chains where one rule sends a user to a URL that is itself redirected by another rule (each extra hop adds latency and erodes the consolidated signal Google attributes to the final destination). Useful for site migrations, domain consolidations, slug renames, URL hygiene after a CMS replatform, decommissioning old marketing landing pages, moving from www to apex (or back), forcing https, and any one-off redirect you need to ship today. Everything is generated locally in your browser. No source URL, destination URL, hostname, or configuration snippet is ever sent off your device.

Free to use. Works in your browser. No signup, no login.

Related tools

You may also like

All tools
All toolsSEO Tools