Redirect Generator (.htaccess & Nginx 301)

Move pages without losing visitors or search ranking. Everything runs in your browser; nothing you enter is uploaded or stored.

  • Free, no sign-up
  • Runs in your browser
  • Verified

How to use it

  1. Choose Apache or Nginx and the status code.
  2. List each old path and its new path or full URL.
  3. Copy the rules into your server configuration.

How it works

For Apache each line becomes a RedirectMatch rule with an exact, escaped pattern (^/old\.html$), so only that exact path is redirected. For Nginx each line becomes location = /old { return 301 …; }. Use 301 or 308 for permanent moves and 302 or 307 for temporary ones.

Examples

  • /old-page.html /new-page/ becomes RedirectMatch 301 "^/old-page\.html$" "/new-page/".

Limitations

  • Only exact paths are handled: query strings, wildcards, regex rewrites and whole-domain moves are not generated. Paths and targets with spaces, quotes or special characters are rejected to keep the rules safe. Test the rules on a staging copy first, since a wrong rule can break a site or cause loops. Other servers (IIS, Caddy, CDNs) have their own syntax.

Last verified . See our Accuracy & Editorial Policy. Found a problem? Email [email protected].