Start a project

Tool 26 of 29 · Server

Redirect Rules Generator

Moving pages or rebuilding a site? Paste your old and new addresses and get redirect rules for your server, with loops, chains and duplicates caught first.

Redirect Rules Generator

Your redirects

Separate with spaces, a comma or a tab. Full URLs or paths both work. Lines starting # are ignored.

    Rules for your server

    Apache (.htaccess)
    Nginx
    Cloudflare Pages / Netlify (_redirects)
    Cloudflare Bulk Redirects (CSV)
    netlify.toml

    Some browsers save .htaccess without its leading dot. If yours does, rename the file to .htaccess before uploading it.

    01

    What it does

    Turns a list of old and new addresses into rules for Apache, Nginx, Netlify and Cloudflare, with loop and chain checks.

    • Apache, Nginx, _redirects, Bulk Redirects CSV and netlify.toml
    • 301, 302, 307 and 308
    • Loop, chain and duplicate checks
    • Chains flattened to the final address

    02

    Private by design

    Everything happens in your browser. Nothing you type, paste or upload is sent anywhere, and it keeps working offline once the page has loaded.

    03

    What you get

    Apache, Nginx, _redirects, CSV and TOML, with a Copy and a Download button on every result.

    • 301
    • SEO
    • .htaccess
    • Nginx

    Why it matters

    When pages move without redirects, old links, bookmarks and search results lead to a 404, and the search ranking those pages earned is lost. A site rebuild is the most common way small businesses lose their Google traffic.

    Redirects themselves can cause problems: a chain (A to B to C) slows every visit and wastes crawl time, and a loop makes a page unreachable. This generator checks for both, and writes the rules in the exact syntax your server or host needs.

    How to use it

    1. Enter your domain and choose the default redirect type (301 for permanent moves).
    2. Paste your old and new addresses, one pair per line.
    3. Check the notes for loops, chains and duplicates.
    4. Copy the rules for your server, publish them, and test a few old addresses.

    FAQ

    301 or 308?

    Both are permanent and pass ranking signals. 308 also keeps the request method, which only matters for forms and APIs. 301 is the usual choice for pages.

    Do redirects lose SEO value?

    Google treats permanent redirects as a strong signal to move ranking to the new address. Keep them in place for at least a year, ideally for good.

    Where does the .htaccess code go?

    In the .htaccess file in your site's root folder, above any other rewrite rules such as WordPress's.

    Why are query strings handled differently?

    Apache can match them; Nginx location blocks, _redirects files and Cloudflare Bulk Redirects ignore them. The checks warn you when that matters.

    Work with me

    Want a site that gets these right?

    I build fast, accessible websites and web apps that pass these checks from day one. Tell me about your project and I'll reply personally with honest next steps.

    All developer tools · Back to leej.uk