301 or 302: what Google says
Google's page on redirects and Google Search, last updated on 14 April 2026 and read by us on 23 October 2026, groups the server-side codes in two: 301 and 308 are permanent and tell Google to show the new URL in results, while 302, 303 and 307 are temporary and keep the old URL there. Google recommends a permanent server-side redirect whenever you are sure the move will not be reverted. Its site-move guide, updated on 20 August 2026, adds three habits worth keeping: send each old URL directly to its final destination, because Googlebot follows at most 10 hops and long chains add delay; keep the number of hops low if you cannot avoid a chain, ideally no more than three; and keep the redirects for as long as possible, generally at least a year.
Apache .htaccess: mod_rewrite rules
For Apache the tool writes RewriteRule lines, as described in the Apache HTTP Server 2.4 mod_rewrite documentation. In an .htaccess file the pattern is matched against the decoded path without its leading slash, so /old-page becomes ^old-page$, anchored at both ends so /old-page-2 is not caught by accident; the simpler Redirect directive matches by prefix, which is why we do not use it. Each rule has R with your status code, L to stop there, and NE so the target, already percent-encoded, is not encoded twice. Old URLs with a query string get a RewriteCond on %{QUERY_STRING}, and QSD drops that query from the target. A literal $ or % in the target is written with a backslash, because mod_rewrite reads $1 and %1 as back-references. Put the block near the top of the .htaccess file, after RewriteEngine On.
nginx, Cloudflare bulk redirects and Next.js
For nginx the tool writes an exact-match location for each path, which the nginx documentation says is compared with the decoded, normalised URI, with return and your status code inside; when the query string should be kept, $is_args$args is added. nginx locations never see the query string, so old URLs with one are matched with an if block on $request_uri, the request exactly as the browser sent it, using the rewrite module's if and return. For Cloudflare the tool writes the bulk redirects CSV described in Cloudflare's documentation: no header row, the source as host and path without a scheme, then the target, the status code and the four TRUE or FALSE options. Cloudflare does not accept a query string in a source URL, so those lines are listed as skipped. For Next.js the tool writes a redirects() block for next.config with statusCode set to your code, because permanent: true would send 308; query conditions use has items, and special characters in a source are escaped as the Next.js docs require.
Loops, chains and conflicts in your list
Redirect lists grow over years and often contradict themselves. The tool reads every line, normalises the old and new addresses, and follows each target through the rest of the list. A self-redirect such as /contact to /contact, or a loop such as /team to /about-us and back, would trap visitors and crawlers, so those rules are left out of the output and named in the checks. A chain such as /a to /b to /c works but costs an extra hop; with the shorten option on, the tool points /a straight at /c and says which lines it changed. Two lines for the same old URL with different targets are a conflict: the first one is kept, because in nginx two identical exact locations stop the configuration from loading. Old URLs on another domain, a fragment after #, which browsers never send to the server, and a redirect of your home page are all flagged for a second look.