Skip to main content

What is a 302 redirect?

Glossary image
Temporary redirect 302 Found

A 302 redirect, also known as a temporary redirect, is an HTTP status code that tells a web browser or search engine that the requested resource has been temporarily moved to a different URL. This type of redirect is used when you temporarily want to send visitors to another page without permanently changing the original URL.

How does a 302 redirect work?

When a server sends a 302 status code, it also provides a new URL address that the browser should fetch instead of the original requested address. The browser performs this redirect automatically without user intervention. Here is a simple explanation of how it works:

  1. Request to the original URL: The user attempts to access a specific URL.
  2. 302 Response from the server: The server responds with a 302 status code and the new URL.
  3. Automatic redirect: The browser redirects the user to the new URL.

When should you use a 302 redirect?

A 302 redirect should be used when you only want to redirect traffic temporarily. Here are some common scenarios:

  • A/B Testing: If you are testing different versions of a page to see which performs best.
  • Seasonal campaigns: To send users to a temporary campaign page without permanently changing the original URL.
  • Website maintenance: If you are performing maintenance on a page and want to redirect users to a temporary page in the meantime.

Important SEO considerations

A 302 redirect tells search engines that the redirect is temporary, so they will continue to index the original URL instead of the new URL. This is important because:

  • Preservation of ranking: Search engines do not pass PageRank or link equity to the new URL, as the redirect is considered temporary.
  • Crawling/indexing: The original page remains indexed, which may be desirable if you plan to return to the original URL soon.

How do you implement a 302 redirect?

Implementing a 302 redirect depends on the server type. For Apache servers you can use a .htaccess file, while on Nginx servers it is done in the configuration files. A typical .htaccess setup might look like this:

Redirect 302 /old-page.html http://www.example.com/new-page.html

Have a question?

Get in touch if you'd like to learn more about this topic.

Contact Us