Redirects and HTTP Status Codes: 301, 302, 404, 410

Блог_баннер_редиректы

The HTTP status code is the first thing a crawler sees when it requests a page. It decides whether the page gets indexed, which URL becomes canonical, and whether the crawler spends its budget on anything useful.

This article was first published in 2020. We have rewritten it from scratch: corrected two claims that were wrong, replaced advice written for interfaces that no longer exist, and added what was missing — Google’s official position on permanent versus temporary redirects.


1. Status code classes

Class What it means What search does with it
2xx Request succeeded. The main one is 200 OK The page is processed and can be indexed
3xx Redirect: the content is available at a different address The crawler follows it and decides which URL to treat as canonical
4xx Client-side error. Mainly 404 and 410 The page eventually drops out of the index
5xx Server error Treated as a temporary failure; the crawler comes back later. Prolonged 5xx slows crawling across the whole site

 

A word about 304 Not Modified. It is often filed under redirects because of the leading 3, but it is not one: the code says the page has not changed since the last request and can be served from cache. It does not point anywhere.


2. Permanent and temporary redirects

Google splits redirects into two groups, and that distinction matters more than the specific number.

Type Codes and methods How Google treats it
Permanent 301, 308, meta refresh with 0 delay, HTTP refresh with 0 delay, JavaScript location A signal that the redirect target should be canonical
Temporary 302, 303, 307, meta refresh with a delay above 0 Not a canonicalisation signal: the original URL stays canonical

 

That wording comes from Google’s own documentation, and it settles the most common confusion in the topic.

Two myths worth dropping.

"A 302 doesn’t pass link equity." It does. Google stated back in 2016 that there is no PageRank loss on any 30x code. The difference is not in equity but in which URL stays in the index: with a 302, that is the old one.

"Leave a 302 up for more than a week and the site gets penalised." No such penalty exists. Google will eventually start treating a long-lived 302 as permanent — but you do not control when that happens, and until it does, the wrong URL sits in the index.

The practical conclusion is simple: choose the redirect type by which URL you want in search results, not by imagined equity loss.

On 308: it behaves like a 301, and Google has confirmed this. The technical difference is that 308 preserves the request method — a POST stays a POST, whereas 301 and 302 historically allowed browsers to switch it to GET. For an ordinary website this changes nothing; it matters for forms and APIs.


3. Which redirect for which situation

Situation What to use
Moving to HTTPS 301 page by page, from each http URL to the same https one
Choosing between www and non-www 301 from the secondary version to the primary, also page by page
A page URL has changed 301 to the new address
Moving to a new domain 301 page by page. Pointing everything at the homepage is the classic mistake
Product discontinued, replacement exists 301 to the specific replacement. With no replacement — 404 or 410, not a redirect
Page down for maintenance 503 with a Retry-After header, not a redirect
A/B test or temporary promo page 302: the original page should stay canonical
Regional version by geolocation 302, and always with a way to switch manually
Different URLs with the same content Not a redirect but a canonical tag — when both URLs must stay reachable

 

The last row is the one most often confused. A redirect removes the page; a canonical leaves it reachable for the visitor and tells search which version to index.


4. Common redirect mistakes

  • Chains. An old URL points to a second old one, which points to a third, and only then to a live page. Every extra hop slows crawling, and a long chain may not be followed to the end. The rule is one hop from the old address to the final one;
  • Loops. A points to B, B points to A. The page is unreachable for anyone;
  • Redirecting to a page that does not exist. A redirect has to land on a URL that returns 200. A redirect to a 404 is worse than a plain 404;
  • Everything to the homepage. During a migration or a catalogue clean-up it is tempting to point hundreds of URLs at the homepage. Google reads this as a soft 404: the target does not match the request, and signals are not passed;
  • Internal links running through redirects. If menus and body text still hold the old addresses, every click and every crawl takes an extra hop. After a URL change the links have to be updated in the content itself — a mandatory step in any rebuild of your site structure;
  • Inconsistent trailing slashes. Some URLs end with a slash, some do not. Pick one and 301 the other;
  • Uppercase in URLs. To the server /Product and /product are different addresses. A 301 to the lowercase version is needed;
  • Duplicated slashes such as /category////product — also a separate URL, worth folding into the clean one with a 301;
  • A redirect instead of a 404 for removed content. If there genuinely is no replacement, an honest 404 beats a redirect to something vaguely related.

5. 404 and 410: removed pages

404 Not Found — the page is gone. Google drops it from the index gradually, while still checking for a while whether it has come back.

410 Gone — the page has been removed permanently. The signal is stronger and the crawler stops returning sooner. The difference is in speed, not in outcome, so 410 makes sense where you are certain the content will not return.

The rule broken most often. A 404 page should not be "redirected to the 404 page". The correct behaviour is to serve the error page content at the requested URL with a 404 status. If instead there is a 301 to /404, you get a redirect to a page that returns 200, and search sees an ordinary page rather than an error.

What the error page should contain:

  • a clear message that the address does not exist;
  • links to the homepage and main sections;
  • site search;
  • the same design and navigation as the rest of the site.

Soft 404 is when a page effectively does not exist but the server answers 200. The classic cases: an empty category, a discontinued product page with no content, a bulk redirect to the homepage. Google flags these separately in Search Console; they need either real content or an honest 404.

For finding broken links: Screaming Frog, Netpeak Spider, Sitebulb, the Indexing report in Search Console, and the Broken Link Checker plugin for WordPress.


6. How to set redirects up

Apache — the .htaccess file in the root folder. The most common method. A single-page redirect:

Redirect 301 /old-page/ https://site.com/new-page/

Site-wide move to HTTPS:

RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

Nginx — in the server configuration, using the return 301 directive. The .htaccess file does nothing here at all, which is a frequent source of confusion: the rules are written and nothing changes.

WordPress — with a plugin. Redirection keeps statistics and catches 404s; Yoast SEO Premium has redirects built in and offers to create one whenever you change a URL.

Shopify — no server access, but there is a built-in tool: Online Store, then Navigation, then URL Redirects. The platform offers to create a redirect automatically when you change a product or page handle.

Other platforms — OpenCart handles redirects through .htaccess or a redirect manager module; Joomla has a built-in Redirects component that also lists broken links.

Whichever method you use, check afterwards that the redirect returns 301 rather than 302 and reaches the destination in a single hop. Some plugins default to a temporary redirect.


7. How to check and how long to keep them

Checking. For a single URL, browser developer tools are enough: the Network tab, Status column. For a whole site — Screaming Frog, Netpeak Spider or Sitebulb, which surface chains, loops and redirects to 404s. In Search Console, URL status appears in the Indexing report.

Check more than the redirect itself: confirm that the canonical URL has actually changed in the index. That takes time — Google has to recrawl the old pages and move the signals, which on a large site means weeks rather than days.

How long to keep them. At least a year, in Google’s own words. The year counts from when Google first crawled the redirect, not from when you set it up. Where possible, do not remove them at all: old URLs live on in bookmarks, emails and other people’s websites, and five years later they still bring people in.


8. In short

  • Permanent redirects (301, 308) signal that the new URL should be canonical. Temporary ones (302, 303, 307) do not.
  • Every 30x code passes link equity. “A 302 doesn’t pass weight” and “302s get penalised” are both wrong.
  • 304 is not a redirect but a response saying the page has not changed.
  • Chains, loops and redirects to 404s do more harm than having no redirect at all.
  • Redirecting everything to the homepage is read by Google as a soft 404.
  • An error page is not redirected to — it is served at the requested URL with a 404 status.
  • 410 clears a page from the index faster than 404; the end result is the same.
  • Keep redirects for at least a year from the first crawl, and preferably permanently.

We check the technical state of a site — status codes, redirects, indexation — as part of an SEO audit, and fix it during on-page optimisation.

Get in touch!

Get More Value

You will get the best content from us to help your business grow.
Your request has been sent.

    Subscribe

    Advance with us — apply now

    Get a free consultation and business promotion assessment
    Your request has been sent.

      Send