Skip to content

Web

301 redirect generator

Write one pair on each line: the old path, a space, then the new path. Copy the rules for Apache or Nginx. Nothing is installed on a server from this page.

Add a pair such as /old-page /new-page.

Example task

Draft a 301 mapping from an old path to its replacement and test for loops before adding the rule to your server configuration.

Put your results to work

Use these results to plan your landing pages, measurement and next improvements.

Explore SEO services in Noida

How this works

Apache gets a Redirect 301 line. Nginx gets a rewrite that matches the old path exactly and returns a permanent redirect. A line with only one path is skipped.

Use a path such as /old-page, or a full URL on the new side when the page moves to another site. Test the rule on the server before you rely on it. A redirect loop is still possible if the new path points back.

Rules you can copy. They are not applied to a live site, and they are not tested for loops.

Questions

Is 301 the right status?+

Use 301 when the move is permanent. A temporary move should be 302, which this page does not write.

Will this keep my rankings?+

A correct 301 is the usual way to pass a moved page to the new address. It is not a promise that rankings stay the same.

Can paths contain spaces?+

No. The split is on spaces, so each line must be exactly two pieces. Encode a space in the path as %20 if you need one.