Back to HTTP Status Codes

301 Moved Permanently 3xx

The requested resource has been permanently moved to a new URL.

What does 301 mean?

A 301 Moved Permanently response tells the client that the requested resource has been assigned a new permanent URL, and any future requests for this resource should go to the new location instead. It's one of the most commonly used redirect codes — and one of the most commonly misused, because the difference between "permanent" and "temporary" redirects has real consequences that aren't always obvious.

A 301 response includes a Location header pointing to the new URL. Browsers automatically follow this redirect, and — importantly — search engines treat a 301 as a strong signal to transfer the original URL's ranking signals (backlinks, authority) to the new URL.

How a 301 behaves

  • Browsers and crawlers cache 301s aggressively. Once a browser learns that URL A redirects to URL B via a 301, it may continue redirecting to B even if the 301 is later removed from the server — this caching is part of why 301s should only be used when you're confident the move is truly permanent
  • It includes a Location header specifying the new URL
  • Search engines transfer ranking signals from the old URL to the new one — this is the primary reason 301 vs 302 matters so much for SEO
  • The HTTP method may change on redirect — historically, some clients convert a POST request into a GET when following a 301, though this behavior is inconsistent across clients (307 was introduced specifically to guarantee the method is preserved — see the comparison below)

Common causes

If you're building the API or website:

  • You're restructuring URLs (e.g., changing /blog/post-name to /articles/post-name) and setting up redirects from old to new
  • You're consolidating duplicate content — multiple URLs that serve the same content now redirect to one canonical URL
  • You're migrating from http:// to https://, or from a non-www to www domain (or vice versa)
  • A CMS or e-commerce platform automatically creates 301s when you rename a page or product slug

If you're calling an API:

  • An API endpoint has been permanently moved to a new path or a new API version, and the old endpoint redirects to the new one
  • Less common in APIs than on websites — most APIs prefer to return errors (like 410 Gone) for deprecated endpoints rather than redirecting, since redirects on API calls can be unexpected for client libraries

If you're a website visitor:

  • You followed an old bookmark or link, and the site automatically took you to the current location of that content — this is the 301 working as intended, you typically won't even notice

How to fix it / use it correctly

As an API/website builder:

  • Use 301 only when the move is genuinely permanent — if there's any chance you'll move the content back or change the destination again soon, use 302 instead, since browsers cache 301s aggressively
  • Update internal links to point directly to the new URL rather than relying on the redirect — redirects add latency and chain too many of them can cause issues
  • Avoid redirect chains (A → B → C) — redirect A directly to C
  • When migrating an entire site (domain change, protocol change), 301 every old URL to its corresponding new URL — a blanket redirect to the homepage loses the SEO value of individual pages

As an API consumer:

  • Most HTTP clients follow redirects automatically, but check your client's configuration — some have redirect-following disabled by default for security reasons
  • If you're caching responses, be aware that a 301 might mean the URL you're caching against has permanently changed — update your stored URL to the new location

As a website visitor:

  • Nothing to do — this is transparent. If a 301 redirect seems to be looping or going to the wrong place, that's a site configuration issue to report to the site owner

301 vs 302 vs 307 vs 308

Code Permanent? Method preserved? (spec-guaranteed) Typical use
301 Moved Permanently Yes Not guaranteed (historically often becomes GET) Permanent URL changes, SEO-significant redirects
302 Found No Not guaranteed Temporary redirects (legacy default, ambiguous)
307 Temporary Redirect No Guaranteed Temporary redirects where the method/body must stay the same (e.g., a POST staying a POST)
308 Permanent Redirect Yes Guaranteed Permanent redirects where method preservation matters

The simplest mental model: 301 and 308 are "permanent" (search engines transfer ranking signals), 302 and 307 are "temporary" (ranking signals stay with the original URL). Within each pair, the newer codes (307/308) guarantee the HTTP method is preserved; the older codes (301/302) historically don't guarantee this, which is the main reason 307/308 exist.

Real-world examples

When companies rebrand and change domains, 301 redirects from the old domain to the new one are standard practice precisely because of the SEO signal transfer — search engines will gradually re-index the new domain's pages with the ranking history of the old ones. Many CMS platforms (WordPress, Shopify) automatically create 301 redirects when a page's slug is changed, specifically to preserve SEO value without requiring manual redirect configuration.

SEO implications

This is the single biggest reason 301 vs 302 matters. A 301 tells search engines "this content has permanently moved — transfer the old URL's ranking signals to the new URL." A 302 tells search engines "this is temporary — keep the old URL as the canonical one, don't transfer signals yet." Using 302 for what's actually a permanent change means the old URL keeps accumulating ranking signals it can no longer use, while the new URL starts from scratch — a common and costly SEO mistake during site migrations.

FAQ

What's the difference between 301 and 302?

301 means the move is permanent — search engines transfer ranking signals to the new URL, and browsers may cache the redirect long-term. 302 means the move is temporary — the original URL remains the canonical one in search engines' eyes, and the redirect isn't cached as aggressively.

Will a 301 redirect pass my page's SEO ranking to the new URL?

Generally yes — this is one of the primary purposes of a 301 redirect, and search engines have explicitly designed their systems to transfer most ranking signals (though not always 100%) from the old URL to the new one.

Why do browsers "remember" a 301 even after it's removed?

Browsers cache 301 redirects aggressively because the code explicitly signals permanence — there's an implicit assumption that a permanent redirect won't need to change again, so caching it long-term is considered safe. This is why 301s should only be used when you're confident about the destination.

Should I use 301 or 308 for a permanent redirect?

308 guarantees the HTTP method (GET, POST, etc.) is preserved on redirect, while 301 historically doesn't guarantee this — some clients convert POST to GET when following a 301. For redirects on form submissions or API calls where the method matters, 308 is the more precise choice. For simple page-to-page redirects (which are almost always GET requests anyway), 301 remains the de facto standard and is universally supported.

Can I redirect an entire site with one 301 to the homepage?

You can, but it's not recommended for SEO. A blanket redirect to the homepage tells search engines that every old URL's content is now "the homepage," which loses the individual ranking value of each page. Mapping old URLs to their specific new equivalents preserves far more SEO value.

Fun fact

301 is one of the few status codes whose number has become shorthand in everyday tech conversation — "just 301 it" is common developer slang for "set up a permanent redirect," independent of the actual HTTP mechanics, similar to how "404" has become slang for "missing" in general usage.

Related Status Codes