Redirect Generator

Write 301 and 302 redirects for Apache .htaccess, nginx, Netlify, Cloudflare Pages or Vercel, with checks for loops.

Runs in your browser. Nothing is uploaded.

Redirects
Whole-site rules (optional)

    How to use the Redirect Generator

    1. Type or paste your redirects, one per line, old address first, then new address, then optionally 301, 302, 307 or 308.
    2. Choose the default redirect type and your server, Apache, nginx, Netlify / Cloudflare Pages or Vercel.
    3. Optionally add whole-site rules, sending visitors to https:// and to the version of your domain with or without www.
    4. Read the warnings about loops, duplicates and chains.
    5. Copy the rules or download the file, and follow the note on where it goes.

    When you redesign a site, rename pages or move to a new platform, old addresses stop working. Visitors following bookmarks and links from other sites land on errors, and search engines drop pages they can no longer find. Redirects fix this by sending each old address to its new home. Every server writes them differently, though, so this generator turns one simple list into the right syntax for yours.

    One list, four formats

    Write your redirects as lines of old new with an optional status code. Paste them from a spreadsheet if you have many; commas, tabs and semicolons work as separators, and full URLs on the old side are reduced to their paths. The tool writes:

    • Apache .htaccess rules with Redirect, RedirectMatch for folders and mod_rewrite for query strings.
    • nginx location blocks and rewrite rules.
    • Netlify and Cloudflare Pages _redirects lines with :splat for folders.
    • Vercel redirects entries for vercel.json, with :path* and query matching.

    Whole-site rules

    For Apache and nginx, add a rule that sends all http:// visitors to https://. For any server, choose whether your domain should always be used with or without www, so search engines see one address per page.

    Catch mistakes before they go live

    The tool checks each line: sources must be paths, destinations must be paths or full URLs, a page can’t redirect to itself, a source shouldn’t appear twice, and a destination that is itself redirected creates a chain. Invalid lines are left out of the output and explained.

    Everything is generated in your browser. For a full list of status codes, see HTTP Status Codes; to control crawling, use the robots.txt Generator.

    Frequently asked questions

    301 or 302?

    Use 301 (or 308) when a page has moved for good; search engines then pass the old page’s ranking to the new one. Use 302 (or 307) for temporary moves, such as a sale page. 307 and 308 keep the request method, which matters for forms and APIs.

    How do I redirect a whole folder?

    End the old address with /*, such as /blog/* /news. Every page under /blog/ goes to the same page name under /news/, so /blog/hello becomes /news/hello.

    Can I redirect old URLs with query strings like ?id=12?

    Yes. The tool writes the special rules each server needs, because a plain Redirect in Apache and a location block in nginx ignore query strings. Cloudflare Pages’ _redirects file can’t match query strings.

    What is a redirect chain?

    A redirect that leads to another redirect. Each hop slows visitors down and can lose ranking signals. The tool warns you so you can point the first address straight at the final page.

    Is anything uploaded?

    No. The rules are written in your browser.

    Tutorials