Nginx redirect generator
One line per move: the old path, then the new path. The link redirect generator outputs the rules for nginx, Apache, Cloudflare Pages / Netlify and a note for Shopify, so a migration does not lose the pages that already rank.
Nginx 301 redirects and rewrites
For a single page, an exact location = /old { return 301 /new; } block is the fastest rule nginx can match and the easiest to read later. Use rewrite only when you need a pattern, for example moving a whole folder: rewrite ^/blog/(.*)$ /articles/$1 permanent;. permanent sends a 301; redirect sends a 302.
Put the generated blocks inside the server { } block for the old host, run nginx -t to test the config, then nginx -s reload. To redirect a whole domain, use return 301 https://new.example$request_uri; in its own server block.
How to use it
Plan the moves first with a redirect mapping template and migration QA workflow. For server configuration, see Nginx 301 redirect examples.
Paste the output where your server reads it, then check that each old URL resolves in one hop with the bulk URL checker. Prefer absolute paths for the new URL. If you moved a whole section, a single prefix rule beats hundreds of lines.
Example: enter /old-product /products/new-product. The nginx output is location = /old-product { return 301 /products/new-product; }. After publishing the rule, paste https://your-site.example/old-product into the bulk checker. Look for one 301 hop followed by a 200 at the intended product page; a second redirect or an unrelated destination needs a rule change.