Comparisons Web & HTTP

301 vs 302 Redirects

A 301 says a page has moved for good; a 302 says it is elsewhere for now. How search engines, browsers and request methods treat each, plus the 307 and 308 variants.

Last reviewed:

AdSense Placeholder
Slot: header_reference_page
On this page

A 301 (Moved Permanently) tells browsers and search engines that the old URL has been replaced for good, so they should use and index the new one. A 302 (Found) says the content is at another URL only for now, so the old URL should stay in use. Use a 301 for domain changes, HTTPS migrations and restructured URLs; use a 302 for short-term moves such as maintenance pages or tests.

At a glance

Code Name Meaning Method on follow
301 Moved Permanently Permanent May change POST to GET
302 Found Temporary May change POST to GET
303 See Other Go and fetch with GET Always GET
307 Temporary Redirect Temporary Same method and body
308 Permanent Redirect Permanent Same method and body

301 and 302 in practice

301 302
Browser caching Cached aggressively Usually not cached
Search engines Treat the new URL as the lasting one Keep the old URL indexed
Typical use HTTP to HTTPS, domain or URL moves Temporary maintenance, A/B tests, location-based routing
Mistake costs Hard to undo because of caching Search engines may not move to the new URL

Check what a URL really does with the HTTP Redirect Chain Tracer, which lists every hop and its status code, and look up unfamiliar codes in the HTTP Status Code Lookup. To write the redirect rules for an Apache server, use the .htaccess Redirect Generator.

Which should you choose?

  • Content has moved for good: 301 (or 308 for non-GET requests).
  • Short-lived or conditional move: 302 (or 307 to keep the method).
  • After a form submission, send to a results page: 303.
  • Unsure: start with a 302 and switch to a 301 once you are certain, because permanent redirects are cached.
  • Avoid chains: point old URLs straight to the final destination, not through several redirects.

The full code list is in HTTP Status Codes Cheat Sheet, and Redirect defines the term.

Try these tools

See also

  • Cheat sheet HTTP Status Codes Cheat Sheet
    The HTTP status codes you will actually meet, grouped by class, with the pairs people confuse (401 vs 403.
  • Glossary Redirect
    A redirect is a server response that sends the browser to a different URL, using a 3xx status code and a Location header.
  • Glossary HTTP
    HTTP (Hypertext Transfer Protocol) is the protocol browsers and servers use to request and send web pages, files and data.
  • Glossary Canonical URL
    A canonical URL is the preferred address of a page when several URLs show the same content, declared with <link rel="canonical">.
  • Glossary HSTS
    HSTS (HTTP Strict Transport Security) is a response header that tells browsers to use only HTTPS for a site for a stated period.

Frequently Asked Questions

A 302 tells search engines the original URL should stay in their index, so the signals are not necessarily passed to the new address. If the move is permanent, use a 301 or 308 so the new URL is treated as the lasting one.

Both are permanent. A 301 historically lets clients change a POST to a GET when following it; a 308 requires the same method and body to be repeated. For ordinary page moves they behave the same.

Browsers may cache a 301 or 308 for a long time, so a mistaken permanent redirect can be hard to undo. Test with a 302 first when unsure.

AdSense Placeholder
Slot: footer_leaderboard