Skip to content

301, 302, 307 and 308 redirects: what the codes mean

Updated 16 November 2026

What do the numbers in a redirect mean?

They're status codes. Every reply a web server sends starts with a three-digit number. Redirect replies start with 3, and the address to go to travels in a Location header1.

For a small site, four of them matter: 301, 302, 307 and 308. Two are permanent and two are temporary1.

Code Name Lasting?
301 Moved Permanently Permanent1
308 Permanent Redirect Permanent1
302 Found Temporary1
307 Temporary Redirect Temporary1

When should I use a permanent redirect?

When the old address won't be coming back. MDN says permanent redirects are meant to last forever, and that search engine robots, feed readers and other crawlers will update the original address1.

The 301 page on MDN puts it this way: the resource has been permanently moved to the URL in the Location header2. A typical use is reorganising a website1.

Google gives a matching rule. Use permanent redirects when you're sure the redirect won't be reverted3. It says 301 and 308 mean a page has permanently moved to a new location3.

When should I use a temporary redirect?

When the page is out of action for a while and you expect it back. MDN says the requested resource has been temporarily moved4, and that crawlers don't memorise the new, temporary address1.

Google gives an example. If a service your site offers is temporarily unavailable, a temporary redirect can send people to a page that explains what's happening. The original address isn't compromised in search results3.

Does the choice matter for search?

It can. Google says visitors generally can't tell the difference, but Google Search uses certain redirects as a signal about which address should be the main one3. In its words, permanent redirects show the new target in search results, and temporary ones show the source page3.

Google also says that with a temporary redirect, the target page might still be indexed if other signals are present3. So the code is a hint, not a guarantee of one outcome.

Choosing between permanent and temporaryIs the old address gone for good?Yes: use a permanent redirectNo: use a temporary redirectCheck it after you set it up
The question is whether the move will be undone.

What's the difference between 301 and 308?

Both are permanent. The difference is in how the browser repeats the request.

Most pages are fetched with a method called GET. Forms often send data with POST. MDN says that when a browser gets a 301 in reply to a POST, it uses GET for the follow-up request2. To stop browsers changing the request, MDN says to use 308 instead2.

The table on MDN's redirect guide lists 308 as "Method and body not changed"1. The same page notes that 308 was created to remove the confusion over non-GET requests1.

For a plain page that people read, none of this shows. It only matters when something is being sent to your site, such as a form.

What's the difference between 302 and 307?

It's the same story on the temporary side. MDN says 307 guarantees the client won't change the request method and body, while with 302 older clients incorrectly changed the method to GET5.

MDN also says 307 and 302 behave the same when the method is GET5. For ordinary page visits, they look alike.

Why 307 and 308 existVisitor submits a formServer answers with a redirectBrowser repeats the requestMethod kept or changed
They keep the form's method; older codes may not.

Which one will my server give me?

It depends on the tool. On Apache's Redirect directive, MDN says the default is a 3021. So if you want a permanent move, say so. MDN shows adding the permanent keyword or a status code to get a different kind1.

That default catches people out. A redirect you meant as permanent can quietly be temporary. After you set one up, check what it really returns.

Many platforms and hosts have their own redirect settings with a choice of code. Read that platform's own help pages, since each one words things differently.

A short rule of thumb

Moved for good? Permanent, usually 301. Moved for now? Temporary, usually 302. Sending form data? Prefer 308 or 307 over their older cousins, per MDN25.

For the permanent case at work, read the rebuild walk-through.

Further reading and sources

  1. Redirections in HTTP, MDN Web Docs (Mozilla)
  2. 301 Moved Permanently, MDN Web Docs (Mozilla)
  3. Redirects and Google Search, Google Search Central
  4. 302 Found, MDN Web Docs (Mozilla)
  5. 307 Temporary Redirect, MDN Web Docs (Mozilla)