The first digit already splits the problem: 4xx means the request was wrong, 5xx means the server failed to answer a reasonable request. That alone tells you which side to look at.
The 4xx you will meet
- 400 - malformed request. Usually a header or a cookie too large, not your code.
- 401 - not authenticated. Log in.
- 403 - authenticated and still not allowed, or the server cannot read the file.
- 404 - not found. If it should exist, the rewrite rule is the suspect, not the file.
- 413 - the upload is larger than the server accepts.
- 429 - rate limited. Something is asking too often, sometimes your own cron.
The 5xx
- 500 - your application errored. The message is in the log, not on the page.
- 502 - the thing behind the web server gave an unusable answer, almost always PHP.
- 503 - deliberately unavailable, or out of capacity.
- 504 - the thing behind was still working when the web server gave up waiting.
Read the real code, not the page
curl -sI https://yourdomain.com/some/page | head -1
A pretty error page returned with a 200 is worse than the error: search engines index it as a real page, and monitoring that checks for 200 never fires. An error page must return its own code.
The two that matter for search
A page that has moved returns 301 and passes its standing to the new address. A page that is gone returns 410 or 404. Redirecting every removed page to the homepage instead is read as a soft 404 and helps nobody.
200 with an empty body is its own bug - usually PHP dying without writing an error. Check the log rather than the page.