Redirect Rule Generator (Apache, Nginx)

Redirect Rule Generator (Apache, Nginx)

Local Processing

Generate .htaccess or Nginx redirect rules from a list of URLs.

How It Works & Processing Standards

Generate .htaccess or Nginx redirect rules from a list of URLs.

Tool processing runs in your browser. If you create a calculator or conversion share link, its values are included in the URL. See the privacy policy for account, analytics and advertising data.

Current Limits

  • Maximum input length: 100,000 characters

Choose Apache or Nginx under "Task" and write "old-path new-path" per line. Create all the rules needed to move URLs without losing search ranking after a redesign.

What You Can Do

Apache
Writes Redirect 301 /old /new.
Nginx
Writes location = /old { return 301 /new; }.

How to Use Redirect Rule Generator (Apache, Nginx)

  1. 1
    Pick the serverApache or Nginx.
  2. 2
    Enter rules"old new" per line, and a status code.
  3. 3
    Add to configPaste into .htaccess or the server config.

Examples

Two Apache rules
Input: /old /new /blog/a /posts/a, 301
Result: RewriteEngine On Redirect 301 /old /new Redirect 301 /blog/a /posts/a
Nginx
Input: /old /new, 301
Result: location = /old { return 301 /new; }

Common Use Cases

  • Moving old URLs after a site redesign
  • Changing the URL pattern for posts

Frequently Asked Questions (FAQ)

How do I choose between 301 and 302?

301 for permanent moves, 302 for temporary ones. Search engines pass ranking signals to the new URL on 301.

Have feedback or ideas for this tool? Suggest & Inquire →