HTTP Status Codes: What 301, 302, 404 and 500 Really Mean
A practical guide to the status codes you meet most often, the difference between permanent and temporary redirects, and how redirect chains hurt.
The five families
Every HTTP response starts with a three digit status code, and the first digit tells you the family. 1xx codes are informational. 2xx means success. 3xx means the client should look somewhere else. 4xx means the request had a problem. 5xx means the server failed to handle a valid request.
Redirects: permanent or temporary
Redirect codes differ in two ways: whether the move is permanent, and whether the request method is kept.
- 301 Moved Permanently: the page has a new address for good. Search engines transfer the old address to the new one over time.
- 302 Found: a temporary move. Search engines keep the original address in their index.
- 307 Temporary Redirect: temporary, and the method must not change, so a POST stays a POST.
- 308 Permanent Redirect: permanent, and the method must not change.
Use a permanent redirect when you have really moved or merged a page, such as when changing domain or switching from www to the bare domain. Use a temporary one for short term cases such as maintenance or a test.
Client errors you will see
404 Not Found means nothing exists at that address. 410 Gone says the page was removed on purpose and is not coming back, which can help search engines drop it faster. 403 Forbidden means the server understood the request and refuses it. 401 Unauthorized means the request needs valid credentials. Despite its name, 401 is about authentication, while 403 is about permission.
A soft 404 is a page that says not found but returns status 200. Search engines treat these as low quality, so a missing page should return a real 404.
Server errors
500 Internal Server Error is a generic failure inside the application. 502 Bad Gateway and 504 Gateway Timeout come from a proxy or load balancer that could not get a good or timely answer from the server behind it. 503 Service Unavailable means the server is overloaded or down for maintenance, and it can include a Retry-After header telling clients when to come back.
Redirect chains and loops
A chain happens when one redirect leads to another, for example http to https and then non www to www. Every extra hop adds delay and gives crawlers one more chance to give up. Googlebot follows a limited number of hops, so aim for one redirect from any old address to its final destination.
A loop is worse: address A sends to B and B sends back to A, so the browser shows an error. A redirect checker follows each hop and lists the status code at every step, which makes chains and loops easy to spot.
Status codes at a glance
This table covers the codes you will check most often and the action each one usually calls for.
| Code | Meaning | Typical action |
|---|---|---|
| 200 | OK, the request worked | Nothing. For a missing page, a 200 is a soft 404 and should be fixed. |
| 301 | Moved permanently | Use for real moves. Update internal links to the new address. |
| 302 | Found, temporary move | Use for short term moves. Do not leave it in place for months. |
| 304 | Not Modified, use the cached copy | Normal. It means caching is working. |
| 400 | Bad Request, malformed request | Check the request syntax and body. |
| 401 | Authentication needed | Send valid credentials. |
| 403 | Refused | Check permissions, not login. |
| 404 | Not found | Restore the page, redirect it or accept it. |
| 410 | Gone on purpose | Use when content is removed for good. |
| 429 | Too Many Requests | Slow down and respect Retry-After if present. |
| 500 | Server error | Check the application logs. |
| 503 | Temporarily unavailable | Wait and retry, or finish maintenance. |
Worked example: tracing a redirect chain
A site owner moves from http://example.com to https://www.example.com and sets up redirects in two separate places. A checker reports these hops for http://example.com/pricing:
- Hop 1: http://example.com/pricing returns 301 to https://example.com/pricing. This is the http to https rule.
- Hop 2: https://example.com/pricing returns 301 to https://www.example.com/pricing. This is the bare domain to www rule.
- Hop 3: https://www.example.com/pricing returns 200.
Two redirects before a page loads is a chain. The fix is to change the first rule so it sends http://example.com/pricing straight to https://www.example.com/pricing in one 301. Run the checker again and confirm the result is one hop, then 200. Also update internal links and the sitemap to use the final address, so crawlers rarely meet the redirect at all.
Common mistakes and how to spot them
- Using 302 for a permanent move. The old address stays in search results. If the move is permanent, switch to 301 or 308.
- Redirecting every missing page to the home page. Visitors lose context and search engines may treat it as a soft 404. Redirect to the closest matching page, or return a real 404.
- Returning 200 for an error page. Test by requesting a nonsense address and checking that the status is 404, not 200.
- Sending a POST through a 301 or 302. Browsers may change it to a GET. When the method must be kept, use 307 or 308.
- A redirect loop caused by two rules that disagree, such as one forcing www and another removing it. The browser reports too many redirects. Trace the hops to find the repeat.
- Blocking a page in robots.txt that also redirects. A crawler that cannot fetch the page cannot see the redirect.
Frequently asked questions
- What is the difference between 301 and 302? 301 says the move is permanent and 302 says it is temporary. Search engines act on that, so use the one that matches the real situation.
- What is the difference between 401 and 403? 401 means you need to authenticate. 403 means the server knows who you are, or does not need to, and still refuses.
- Does a 404 hurt my site rankings? A few 404 pages for content that never existed are normal. Many broken links to pages that should exist are worth fixing.
- What causes a 502 Bad Gateway? A proxy or load balancer got an invalid response from the server behind it. The usual cause is that the application crashed or is not listening.
- How many redirects are too many? Aim for one. Browsers and crawlers stop after a limited number of hops, and each hop adds delay.