301 redirect generator

Enter old and new URL pairs, one per line. Generate 301 rules for your selected server and identify some potential conflicts.

  1. Paste pairs: old URL, a space or comma, then new URL.
  2. Choose your server type.
  3. Copy the rules into your server configuration.

301 redirect generator

  • Free
  • Runs in your browser
  • No registration

Separate with a space, tab (from Excel) or comma.

Server
Rules
 

    Preparing URL pairs

    Enter an old URL and its final destination on each line, for example /old-page/ /new-page/. Separate the pair with a space, tab, comma or semicolon. Copying two spreadsheet columns is convenient, but URLs must not contain unencoded spaces.

    For a complete source URL, the domain is removed and the path and query parameters are used. Generate rules for one specific website server. This method does not distinguish two domains with the same path. Enter the new destination as a final path or complete target URL.

    Apache and Nginx outputs differ

    Apache output uses mod_rewrite and exact-match RewriteRule rules. It is designed for .htaccess, so do not paste it into an arbitrary part of server configuration. Check that your hosting supports this rewriting and where existing URL rules run.

    For simple paths, Nginx output uses a location = rule with return 301. Add it to the appropriate server block, check configuration syntax and reload according to your hosting procedure. Nginx does not use .htaccess.

    For source query parameters, such as /?id=12, Apache output includes an additional condition. This Nginx version instead produces a comment saying parameters need a separate check. The comment does not redirect anything; a server administrator must prepare the rule for this case.

    Warnings and checks after implementation

    The tool flags missing destinations, duplicate source paths, self-redirects and possible chains. For example, /a/ to /b/ and /b/ to /c/ introduce an intermediate step; normally /a/ should point directly to /c/. Rules are not generated until the highlighted errors or conflicts have been corrected.

    Back up configuration before changing it. After implementation, check the old URL's actual HTTP response: it should return 301, with Location pointing to the intended final URL and the correct page loading without a loop. Separately check parameters, capitalisation, trailing slashes and existing domain or HTTPS rules.

    A redirect signals a URL change but does not automatically update internal links, canonicals or sitemaps. Update them to final URLs. The generator checks neither source nor destination pages and does not connect to your server.

    Frequently asked questions

    Can I deploy this code immediately on any hosting?

    No. First identify the server and where rules belong. Nginx and Apache syntax differ, and managed hosting may provide its own redirect interface.

    Does the rule count mean every redirect will work?

    No. It counts processed URL pairs. For Nginx query-parameter cases, output may only be a comment. Server checks and actual HTTP responses confirm functionality.

    Does the tool generate 302 redirects?

    No. This version generates permanent 301 redirect templates. Temporary redirects require a separate solution.

    Why should I not redirect all old pages to the homepage?

    The destination should match the content a visitor expects. If a direct equivalent exists, redirect there. If content was removed without a replacement, choose the appropriate HTTP response separately.

    Other free tools

    All tools

    HTML cleaner

    Remove HTML styles and unnecessary tags while preserving text structure.

    Character counter

    Count characters, words, repeated terms and estimated reading time.

    Google search result preview

    Estimate title and meta-description width in desktop and mobile layouts.

    Migrating a website and concerned about traffic?

    Website migration