301 Redirect Generator (.htaccess & Nginx)

Create 301 or 302 redirect rules for Apache .htaccess and Nginx from a list of old and new URLs.

About this tool

When a page moves, a redirect sends visitors and search engines to the new address. Enter one pair per line and copy the rules.

How to use 301 Redirect Generator (.htaccess & Nginx)

  1. Enter old path and new URL on each line, separated by a space.
  2. Choose the redirect type.
  3. Copy the Apache or Nginx rules into your server config.

Frequently asked questions

301 or 302?

Use 301 for permanent moves and 302 for temporary ones.

Where does the code go?

Apache rules go in .htaccess. Nginx rules go inside your server block, followed by a reload.