Nginx Redirect Generator
Generate clean Nginx redirect rules for single URLs, folders or full domain moves without hand-writing server config.
The Nginx redirect generator builds clean, copy-ready Nginx redirect rules for single URLs, folder moves, and full domain migrations without making you hand-write fragile server config. Pick your source, destination, redirect type (301 or 302), and scope, then paste the generated block straight into your server file or include.
Getting redirects right matters for SEO. A wrong status code or a botched rewrite can drop your rankings and break crawling, which directly hurts the local visibility you work hard to earn. This nginx redirect generator uses the correct location, return, and rewrite directives so link equity passes the way you intend and visitors land on the right page every time. When you are ready to track how those URL changes affect your Google Maps and local pack positions, ProMapRanker can monitor your grid rankings before and after the move, start free.
Use the single path mode for one URL, the wildcard folder mode to map an entire directory with path preservation, and the domain mode to point an old domain at a new one with a single return statement. Copy or download the result and you are done.
FAQ
What is the difference between a 301 and 302 redirect in Nginx?
A 301 is a permanent redirect and tells search engines to pass ranking signals to the new URL and update their index. A 302 is temporary and signals that the original URL will return, so engines keep the old URL indexed. Use 301 for permanent moves and 302 only for short-term changes like maintenance or A/B tests.
Should I use return or rewrite for an Nginx redirect?
Use return for simple, exact redirects because it is faster and clearer, for example a single page or a whole domain move. Use rewrite with a capture group when you need to preserve the rest of the path under a folder, such as sending everything in /old/ to /new/ while keeping the trailing segments intact.
Will these Nginx redirects preserve my SEO rankings?
A correctly configured 301 redirect passes the large majority of link equity to the destination, so rankings generally carry over once Google recrawls. Make sure each old URL maps to the most relevant new URL rather than dumping everything onto the homepage, and monitor your positions afterward so you can catch any drops early and fix broken mappings.
Related tools
Hreflang Tag Generator
Generate correct hreflang link tags for multilingual and multi-region sites, including x-default. Prevents the most common international SEO mistakes.
Open →htaccess Redirect Generator
Generate correct 301/302 redirect rules and common rewrite snippets for your .htaccess file. Saves agencies time and errors during migrations.
Open →Robots.txt Generator
Build a valid robots.txt with allow/disallow rules, crawl-delay, AI-bot blocking, and sitemap reference. High-volume evergreen technical SEO utility.
Open →Robots.txt Tester
Paste your robots.txt and a URL to instantly see whether a given crawler is allowed or blocked, before it costs you indexing.
Open →Slug Generator
Convert any title into a clean, SEO-friendly URL slug with stopword removal and custom separators. The lowest-difficulty SEO tool keyword tested.
Open →URL Parameter Cleaner
Strip tracking and junk query parameters from a URL to get the clean canonical version for links and audits.
Open →Track your real Google Maps rankings
These free tools get you set up - ProMapRanker shows where you actually rank across your whole service area on a geo-grid.
Start free - 150 credits