Skip to content
Devtoolry

.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

  1. Paste old and new URLs, one pair per line (space, tab or comma between them).
  2. Pick the redirect type: 301 for permanent moves, 302 for temporary ones.
  3. Switch on Force HTTPS and the www rule if you need them, and enter your domain.
  4. 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

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.