Status codes explained

301, 302, 307, 308: which redirect is which?

Redirect codes are road signs. Some say “permanent diversion — use the new road from now on”, others say “temporary, the old road reopens soon”. Here’s every one you’ll meet, in plain English.

Three-question picker

Which code do I need?

Answer a couple of questions about what’s moving and we’ll tell you the right status code — and why.

PermanentTemporary
May change POST to GET301302
Keeps method & body308307

That little table is 90% of it. 303 is the odd one out: always “now GET this”.

Redirect picker

The full set

Every code you’ll meet.

301
Permanent

301 Moved Permanently

The workhorse. “This page lives somewhere else now, for good.” Browsers cache it, and search engines swap the old URL for the new one in their index and pass its signals across.

Use for
Domain moves, URL changes, HTTPS, merging pages — almost every real move.
Method
Browsers may turn a POST into a GET when following it (historical behaviour). Fine for web pages.
Caching
Cached by browsers, often for a long time. Test with 302 first.
SEO
Strong signal that the target should be the indexed, canonical URL.
308
Permanent

308 Permanent Redirect

The strict twin of 301: permanent, and the browser must repeat the request exactly — POST stays POST, with its body.

Use for
APIs, webhooks and form endpoints that have moved permanently.
Method
Preserved.
Caching
Cached like a 301.
SEO
Google treats it the same as a 301.
302
Temporary

302 Found

“It’s over there for now, but keep using this address.” Search engines usually keep the original URL indexed.

Use for
Short promotions, temporary maintenance pages, geo/language routing, A/B tests, testing a redirect before going permanent.
Method
Like 301, POST may become GET.
Caching
Not cached unless headers say so.
SEO
Weak signal. Left in place for a long time, Google may eventually treat it like a 301 — but don’t rely on that.
307
Temporary

307 Temporary Redirect

The strict twin of 302: temporary, and the method and body are preserved.

Use for
Temporarily moving an API endpoint or form handler.
Method
Preserved.
SEO
Treated like a 302.
Also seen as
“307 Internal Redirect” in Chrome DevTools — that’s the browser upgrading to HTTPS because of HSTS, not your server.
303
Temporary

303 See Other

“Done — now go and GET this other page.” Used after a form submission so refreshing doesn’t resubmit it (the Post/Redirect/Get pattern).

Use for
After a POST: order placed → order confirmation page.
Method
Always becomes GET.
SEO
Treated as temporary. Not for moving content.
410
Not a redirect

410 Gone

“This existed, it’s been removed on purpose, and it isn’t coming back.” The honest answer when there’s no sensible replacement page.

Use for
Discontinued products with no equivalent, deleted spam pages, expired campaigns.
SEO
Dropped from the index; possibly a touch faster than a 404.
Apache
RewriteRule ^old-page$ - [G]
404
Not a redirect

404 Not Found

The page doesn’t exist. Perfectly normal for URLs that never had content — but if an old page had links or traffic, a 301 to its closest replacement is kinder.

Watch out
A redirect to your homepage for every missing page isn’t a fix — Google calls it a “soft 404”.

When you can’t touch the server

Client-side “redirects”.

These happen in the browser after the page loads. They work, but a real server-side 301 is always faster and clearer.

Meta refresh

An HTML tag that tells the browser to go elsewhere. With a 0-second delay Google treats it much like a permanent redirect; with a delay, more like a temporary one. Use only when you can’t touch the server (e.g. some static hosts).

html
<meta http-equiv="refresh" content="0; url=https://example.com/new">

JavaScript

Works for people with JavaScript, and Google can follow it once it renders the page — but it’s slower, less reliable and the weakest signal. A last resort.

html
<script>location.replace("https://example.com/new");</script>

Canonical tag

Not a redirect at all: visitors stay put. It’s a hint to search engines about which of several duplicate URLs to index. Use it when both URLs must keep working (e.g. tracking parameters).

html
<link rel="canonical" href="https://example.com/the-real-one">

Common questions

Is a 308 better than a 301?

Only if the method matters. For ordinary web pages, 301 is universally understood and perfectly fine. For APIs and forms, 308 guarantees a POST isn’t silently turned into a GET.

How do I see which code a URL returns?

Trace it here, run curl -I https://example.com/page in a terminal, or open your browser’s DevTools → Network tab and tick “Preserve log”.

Can I change a 301 to a 302 later?

You can change the server, but browsers that already saw the 301 may keep using their cached copy for a long time. That’s why you test with 302 and only switch to 301 when you’re sure.

What about 300 and 305?

300 Multiple Choices is almost never used, 304 Not Modified is a caching response (not a redirect), and 305/306 are deprecated. You can safely ignore them.