0
0
SeoConceptBeginner · 3 min read

What Is a 302 Redirect and How It Works

A 302 redirect is a temporary redirect status code that tells browsers and search engines a webpage has moved temporarily to a different URL. Unlike a permanent redirect, it does not pass full SEO value to the new page because the original URL is expected to return soon.
⚙️

How It Works

A 302 redirect works like a temporary detour sign on a road. When someone tries to visit a webpage, the server responds with a 302 status code telling the browser, "This page is temporarily at a different address." The browser then goes to the new URL but remembers the original one for future visits.

This means search engines understand the move is not permanent and keep the original page indexed instead of replacing it with the new URL. This helps when you want to send visitors somewhere else for a short time without losing your page's search ranking.

💻

Example

This example shows how to set a 302 redirect using an HTTP header in PHP. It tells the browser to temporarily go to a new page.

php
<?php
// Send a 302 redirect header
header("Location: https://example.com/new-page", true, 302);
exit();
?>
Output
The browser redirects to https://example.com/new-page temporarily.
🎯

When to Use

Use a 302 redirect when you want to send visitors to a different page temporarily. For example:

  • During website maintenance or updates
  • When testing a new page without affecting SEO
  • For seasonal promotions or limited-time offers

It is important not to use 302 redirects for permanent moves because search engines may not transfer ranking signals to the new URL.

Key Points

  • A 302 redirect is temporary and does not pass full SEO value.
  • It tells browsers and search engines the original URL will return.
  • Use it for short-term page moves or testing.
  • For permanent moves, use a 301 redirect instead.

Key Takeaways

A 302 redirect signals a temporary page move to browsers and search engines.
It preserves the original URL's SEO value because the move is not permanent.
Use 302 redirects for short-term changes like maintenance or testing.
Avoid using 302 redirects for permanent URL changes to maintain SEO benefits.