Redirect Generator

Generate 301 or 302 redirect rules for Apache, Nginx, or PHP when a page, permalink, or website URL moves.

Runs in your browserNo account requiredUpdated October 5, 2026
Redirect rule
Enter an old path and new URL.

Generate a starting redirect rule when an old URL needs to send visitors and search engines to a new destination. Choose Apache, Nginx, or PHP and select a permanent or temporary redirect based on the type of move. For migrations, keep a redirect map and test the final status code and destination so you avoid chains, loops, accidental broad matches, and irrelevant homepage redirects.

Generate a redirect rule for a URL move

Redirects send visitors and crawlers from an old URL to a new destination. Use this generator to produce a starting rule for Apache, Nginx, or PHP without having to remember the exact syntax each time.

301 vs 302

A 301 redirect signals that the move is intended to be permanent. A 302 signals a temporary move. For a site migration, renamed page, or permanently consolidated URL, 301 is normally the appropriate choice. For a short-lived campaign or temporary routing change, 302 may be more suitable.

Redirect only what you intend to redirect

Broad pattern rules can accidentally catch admin pages, assets, API routes, or URLs that were never meant to move. Test a specific old URL and several nearby URLs after adding any server-level rule.

Avoid redirect chains

If /old/ redirects to /older/ and then to /new/, visitors and crawlers have to follow multiple hops. Update the first rule to point directly to the final URL whenever possible.

Keep a redirect map during migrations

For larger redesigns, track the old URL, new URL, status code, and verification status in a spreadsheet. That makes it much easier to audit missing routes after launch.

Frequently asked questions

Should every deleted page redirect to the homepage?

No. Redirect to the closest genuinely equivalent page. If no useful replacement exists, a proper 404 or 410 can be clearer than an unrelated homepage redirect.

Can a redirect fix a broken relative link inside content?

It can mask the symptom, but updating the link at its source is usually better when you control the content.