.htaccess & Nginx Redirect Generator
Generate 301 and 302 redirects for a list of old and new URLs as .htaccess, Nginx, Netlify, Vercel or Next.js rules, plus force-HTTPS and www redirects.
Runs in your browser · Nothing uploaded · No sign-up
Something not working, or missing a feature? Send feedback
About the .htaccess & Nginx Redirect Generator
The .htaccess and Nginx Redirect Generator turns a list of old and new URLs into ready-to-paste redirect rules for Apache (.htaccess), Nginx, Netlify, Vercel and Next.js. Choose 301, 302, 307 or 308, add force-HTTPS and www or non-www redirects, and paste whole spreadsheets of URLs. Old URLs with query strings get the right rewrite conditions, and the tool warns about duplicates, loops and redirect chains before you deploy.
Files and tags are generated in your browser; nothing you enter, including unpublished URLs and titles, is sent to a server.
How to use the .htaccess & Nginx Redirect Generator
- Paste old and new URLs, one pair per line (space, tab or comma between them).
- Pick the redirect type: 301 for permanent moves, 302 for temporary ones.
- Switch on Force HTTPS and the www rule if you need them, and enter your domain.
- Pick your server, copy the rules into the file named below the output, and test old URLs with the Redirect Checker.
Works well with the .htaccess & Nginx Redirect Generator
- Redirect Checker: test the redirects after you deploy them.
- Broken Link Checker: find old links that still point to moved pages.
- HTTP Status Checker: check the status codes of the old URLs in bulk.
Frequently asked questions
301 or 302: which redirect should I use?
Use 301 (or 308) when a page has moved for good: search engines move its ranking signals to the new URL and update their index. Use 302 (or 307) for temporary moves such as a sale page, when the old URL will come back. 307 and 308 keep the request method, which matters for forms and APIs.
Where is the .htaccess file?
In the root folder of your site (public_html on most shared hosting), next to index.php. It starts with a dot, so enable "show hidden files" in your file manager. WordPress already has one: add your rules above the "# BEGIN WordPress" block.
Why avoid redirect chains?
Each extra hop slows visitors down, and Googlebot follows only a limited number of hops (up to 10) before giving up. Point every old URL straight at its final destination.
Related tools
Robots.txt Checker
Validate a live or pasted robots.txt the way Google reads it: syntax errors, blocked pages and resources, sitemaps, 21 search and AI crawlers, and a URL tester.
Googlebot Simulator
See a page as Googlebot, Bingbot or GPTBot and as a visitor, side by side: status, redirects, title, canonical, noindex and text, to catch cloaking.
Robots.txt Generator
Create a robots.txt file with rules per crawler, sitemap links and presets for WordPress or blocking AI bots, then test any URL against it in your browser.
Canonical & Noindex Checker
Check a URL's canonical tag and Link header, robots meta, X-Robots-Tag and robots.txt, and whether the canonical target itself works, with a clear indexing verdict.
Hreflang Checker
Validate a page's hreflang tags: language and region codes, self-reference, x-default, relative URLs and canonical conflicts, and whether every alternate links back.
Hreflang Generator
Generate hreflang tags for your language and country versions as HTML link tags, XML sitemap entries or an HTTP Link header, with every code validated as you type.