Nightcrop
LoginGet started

What Is a Redirect? Types, Codes and SEO Effects

Nightcrop · November 26, 2026

A redirect sends visitors and crawlers from one URL to another automatically. The server answers a request with a status code in the 300 range and a new address. Permanent redirects (301, 308) tell search engines the move is lasting. Temporary ones (302, 307) say the original will return.

How does a redirect work?

When a browser asks for a URL, the server can reply with a redirect instead of a page. MDN explains that redirect responses have status codes that start with 3 and a Location header holding the new address. The browser then requests that address. The visitor sees the new page and the address bar changes.

Which redirect codes exist?

CodeMeaningUse it when
301Moved permanentlyA page has a new URL for good
308Permanent redirect, method keptSame as 301, but form posts or API calls must keep their method
302Found (temporary)The move is short term, such as a maintenance page
307Temporary redirect, method keptSame as 302, with the method preserved

For ordinary web pages fetched with GET, 301 and 308 behave the same for search, and so do 302 and 307. The difference matters for non-GET requests: MDN notes that a 308 keeps the method and body unchanged, while a 301 may turn other methods into GET. For a deeper comparison of the two most common codes, see 301 vs 302 redirect.

What does Google do with a redirect?

Google's documentation says that permanent redirects show the new target in search results, while temporary redirects keep showing the source page. Google recommends a permanent server-side redirect whenever possible when a URL changes, and says to use a permanent redirect only when you are sure the change will not be reversed.

Google also says it treats an instant meta refresh as a permanent redirect and a delayed one as temporary. It warns that JavaScript redirects are the least reliable, because rendering may fail and Google might never see the redirect.

When should you use a redirect?

Redirect to the closest matching page, not always the home page. Sending every old URL to the home page can be treated as a soft 404 by Google; see soft 404 errors.

What goes wrong with redirects?

  1. Chains. A to B to C wastes time and crawl effort. Point A straight to C. The fix is in how to fix redirect chains.
  2. Loops. A to B to A. The page never loads. Browsers show an error.
  3. Using a temporary code for a permanent move. Search engines may keep the old URL in results.
  4. Redirecting to an unrelated page. Visitors bounce, and search engines may ignore the redirect.

How do you check a redirect?

Run curl -I https://example.com/old-page in a terminal. Look at the first line for the status code and at the Location header for the target. You can then run it again on the target to make sure it answers 200 directly. For the setup side, see how to do a 301 redirect.

Frequently Asked Questions

Is a redirect the same as a canonical tag?

No. A redirect moves the visitor. A canonical tag leaves both pages reachable and hints which one to index.

Does a redirect hurt SEO?

A correct one does not. Chains, loops and redirects to unrelated pages cause problems.

Which code should I use by default?

Use 301 for permanent moves and 302 for short ones. Use 308 or 307 when non-GET requests are involved.

How long should I keep a redirect?

Keep it as long as the old URL gets visits or has links pointing to it. In practice that often means indefinitely.

Can I use JavaScript to redirect?

Only if you cannot do it on the server. Google says rendering may fail, so it can miss the redirect.