NathanTools
NathanTools
Text Tools 13
SEO Tools 7
Image Tools 19
YouTube Tools 38
Device Tests 4
PDF Tools 10
Calculators 52
Electrical Calculators 10
Time Tools 7
Random Tools 9
Converters 14
Developer Tools 11
Hash Generators 5
Password & Security 2
Network & DNS 3
Website Tools 9

301 Redirect Generator

Choose what to redirect and your server, and copy ready-made redirect rules.

100% free No sign-up Works on any device
Redirect type

Code

Updated November 2026 · Generated in your browser

How to use the redirect generator

  1. Choose what to redirect: one page, a whole domain, HTTP to HTTPS, or www to non-www (or the other way).
  2. Fill in the addresses and pick the status code; 301 is right for almost every permanent move.
  3. Choose your server or platform tab, copy the code, and add it where the note under the code says.

Redirect status codes

CodeMeaningSEOUse for
301Moved permanentlyPasses ranking to the new URLMoved pages, new domains, HTTPS
308Permanent redirectSame as 301APIs and forms where POST must stay POST
302Found (temporary)Old URL stays indexedShort-term moves, maintenance
307Temporary redirectOld URL stays indexedTemporary, keeping the request method

After adding a redirect, confirm it with the HTTP header checker.

Frequently asked questions

A 301 is permanent: browsers cache it and search engines move rankings to the new URL. A 302 (or 307) is temporary: search engines keep the old URL indexed. Use 301 for moved pages, domain changes and HTTP→HTTPS. Use 302 for short-term maintenance or A/B tests. 308 is the permanent version that keeps the request method (useful for POST).

In a file named .htaccess in your site's root folder (usually public_html) on an Apache or LiteSpeed server. Put redirect rules near the top, before other rewrite rules such as WordPress's. Back up the file first: a typo can cause a 500 error for the whole site.

A server-side 301 (.htaccess, Nginx, IIS or your host's settings). Google also follows meta refresh and JavaScript redirects, but they're slower, and other search engines and tools may not treat them as permanent. Use them only when you can't change the server.

Open the old URL in a private window, or check it with the HTTP header checker, which shows each hop's status code and Location header. Avoid chains (A → B → C) and loops; redirect old URLs straight to the final address.

Common causes: the server isn't Apache or LiteSpeed (Nginx ignores .htaccess), mod_rewrite isn't enabled, another rule above catches the request first, or your browser cached an older 301. Test in a private window after each change.
Esc
↑ ↓ to moveEnter to open