HTTP Status Codes Reference & Lookup
Instant searchable reference for HTTP status codes (200, 301, 304, 400, 401, 403, 404, 429, 500, 502, 503, 504) with API debugging and SEO impact guidance.
| Code | Name | Meaning & Debugging / SEO Tip |
|---|
HTTP Status Classes & SEO Impact Summary
- 2xx (Success): Search engines index
200 OKnormally. Avoid returning200 OKon empty "not found" pages (soft 404). - 3xx (Redirection): Use
301or308for permanent URL migrations to pass canonical signals; use302or307only for temporary routing. - 4xx (Client Error):
404and410drop removed URLs from indexes over time;429 Too Many Requeststells crawlers and API clients to back off viaRetry-After. - 5xx (Server Error): Sustained
500/502/503/504responses throttle crawl budget and degrade rankings—always verify origin health and upstream timeouts.
Frequently Asked Questions
What is the difference between 401 Unauthorized and 403 Forbidden?
401 means the client has not proven who they are (missing/expired login or token). 403 means the server understands the request but refuses to grant access even with credentials.
Should I use 301 or 302 when moving a web page permanently?
Use 301 (or 308) for permanent moves so Google and Bing consolidate ranking signals onto the new canonical URL.
How do I fix a 502 Bad Gateway error?
502 happens when a proxy like nginx or Cloudflare cannot get a valid HTTP response from the origin process—check whether the backend service crashed, restarted, or listens on the expected port.
Quick Triage: Choosing the Exact HTTP Status Code for REST APIs & SEO
- 301 vs 302 vs 308: Use
301(or308to preserve HTTP POST method) for permanent URL migrations so search engines transfer canonical ranking signals; use302/307strictly for temporary redirects. - 401 vs 403: Return
401 Unauthorizedwhen authentication is missing or expired (login needed), and403 Forbiddenwhen the user is authenticated but lacks permission. - 429 Too Many Requests: Always include a
Retry-Afterheader when rate-limiting API clients.
Frequently Asked Questions
- When should an API return 400 vs 422?
- Use 400 Bad Request for malformed JSON or syntax errors, and 422 Unprocessable Entity when syntax is valid but business validation rules fail.
- Does a 404 or 410 remove a deleted page from search faster?
- Both drop a URL from search indexes; 410 Gone signals an intentional permanent removal rather than a potentially accidental 404.
- What causes 502 Bad Gateway vs 504 Gateway Timeout?
- 502 means an upstream server returned an invalid response or crashed; 504 means the upstream server did not respond before the proxy timeout expired.