Redirect Generator

  • Free, no sign-up
  • Instant results
  • Works on mobile

Redirect Generator: .htaccess, Nginx and CSV Redirect Rules

Paste your old and new URLs, one pair per line. The tool writes ready-to-use redirect rules and checks your list for loops, chains and duplicates before you upload anything.

Separate the two URLs with a space, comma, tab or ->. Use full addresses or paths. Add a status code at the end of a line to override the default, for example /old /new 302. Lines starting with # are ignored. A single URL with no destination becomes a 410 Gone when the default status is 410.

2. Options
3. Output format

Check your list
    Follow a URL through your rules

    How to add the rules to your website

    1. Enter your old and new URLs and pick the right format for your server.
    2. Fix anything marked red in the check. Collapse chains so each old URL goes straight to its final page.
    3. Copy the rules. On Apache or LiteSpeed hosting, paste them into the .htaccess file in your site root. On WordPress, put them above the # BEGIN WordPress line so WordPress does not handle the URL first. On Nginx, add the rules to your server block and reload Nginx.
    4. Keep a copy of the old file before you change it. A typing mistake in .htaccess can take the site down with a 500 error.
    5. Test a few old URLs in the box above, then in a browser or with a redirect checker.

    Which status code should I use?

    CodeMeaningUse it when
    301Moved permanentlyA page has a new address for good, you changed a URL, or you moved to a new domain. This is the usual choice for SEO moves.
    308Permanent redirectSame as 301, but browsers must repeat the same request method (a POST stays a POST).
    302Found (temporary)The move is short term, such as a maintenance page or an A/B test.
    307Temporary redirectSame as 302, but the request method is kept.
    410GoneThe page was removed on purpose and has no replacement. It tells crawlers the URL is gone for good.

    Redirect chains and loops

    A chain happens when A goes to B and B goes to C. Every extra step slows the page and wastes crawl budget. Googlebot follows a limited number of hops (up to 10), and visitors on slow connections feel each one. Point A straight at C. The “Collapse chains” button does this for you.

    A loop happens when A goes to B and B goes back to A. Browsers stop with an error such as “too many redirects”, and the page cannot be opened. The check flags every loop so you can fix it before upload.

    Good habits for redirects

    • Redirect to the page that matches the old one. Sending everything to the home page is treated like a soft 404 by search engines.
    • Keep permanent redirects in place for at least a year. Google recommends keeping them as long as you can.
    • Update your internal links, menus and sitemap to the new URLs instead of relying on redirects.
    • Do not redirect a URL that is also blocked in robots.txt. Crawlers cannot see the redirect if they cannot fetch the old URL.
    • Moving a whole site? Use the HTTPS and www options only after the new site is working, and keep the old domain registered.

    Related tools

    Redirect Checker · HTTP Status Code Checker · Robots.txt Generator · Sitemap Checker · Broken Link Checker

    Frequently asked questions

    Where is the .htaccess file?

    It sits in the root folder of your website, next to wp-config.php on WordPress. You can open it in your hosting file manager or over FTP. It is a hidden file, so turn on “show hidden files” if you cannot see it.

    What is the difference between the RewriteRule and Redirect formats?

    RewriteRule (mod_rewrite) can match query strings and exact paths, and is the safer choice on WordPress. Redirect (mod_alias) is simpler but matches every URL that starts with the old path unless you keep “Exact match only” on.

    Do 301 redirects hurt SEO?

    A correct 301 passes the signals from the old URL to the new one, and Google says there is no penalty for using redirects. Problems come from long chains, loops, and redirecting to unrelated pages.

    Can I redirect a URL that has a query string?

    Yes. Write the old URL with its query, for example /page.php?id=12 /new-page/. The tool adds the extra condition that RewriteRule needs, or the matching block for Nginx.

    How do I redirect my whole site to a new domain?

    Add one rule for each old URL that has a new address, and send everything else to the new home page or the matching path. Large moves are best done with a rule that maps paths one-to-one, which your host or developer can set up. Use this tool for the page-by-page rules.

    My site shows a 500 error after I pasted the rules.

    Restore your backup of the .htaccess file, then add the rules a few at a time. The usual causes are a missing line break, a rule placed inside another block, or a server that does not allow the directive.

    Do I need a plugin instead?

    Not necessarily. Plugins such as Rank Math or Redirection store redirects in WordPress and are easier for non-technical users. Server rules run before WordPress loads, so they are faster and still work if a plugin is switched off.

    About this tool. The generator writes standard Apache (mod_rewrite and mod_alias), Nginx, CSV and Netlify syntax. We checked every format against sample lists that include query strings, trailing slashes, spaces, full URLs, 410 rows, duplicates, chains and loops. The generator and the checker run in your browser, so your URLs are not sent to our server. Always keep a backup of your server files and test on a few URLs before you rely on the rules.

    Last reviewed: October 2026.

    Try these next

    Share this tool

    Scroll to Top