Servers provide a three-digit HTTP status code for each resource request they receive. Status codes in the 400s and 500s indicate that there's an error with the requested resource. If a search engine encounters a status code error when it's crawling a web page, it may not index that page properly.
Key Term: Crawling is how a search engine updates its index of content on the web.
How the Lighthouse HTTP status code audit fails #
Lighthouse flags pages that return an unsuccessful HTTP status code (in the 400s or 500s):
How to fix an unsuccessful HTTP status code #
First make sure you actually want search engines to crawl the page. Some pages, like your 404 page or any other page that shows an error, shouldn't be included in search results.
To fix an HTTP status code error, refer to the documentation for your server or hosting provider. The server should return a status code in the 200s for all valid URLs or a status code in the 300s for a resource that has moved to another URL.
If you're using Github Pages to host a single-page app, you'll likely need to serve valid content with a 404 status code.
Try it! Single-page applications can make fixing HTTP status code errors a bit more complicated. Learn how to fix sneaky 404s in an Express application.