TR

Home / Guides / What Are HTTP Status Codes? 200, 301, 404, 500 and Troubleshooting

What Are HTTP Status Codes? 200, 301, 404, 500 and Troubleshooting

Updated: November 6, 2026 · AracMerkezi

▶ Open HTTP Status Codes Reference

An HTTP status code is the three-digit number the server gives at the start of every response, and its first digit tells you whom the problem lies with: 2xx success, 3xx redirection, 4xx request side, 5xx server side. Instead of listing the codes like a dictionary, this guide explains how to solve "why won't this page open?" step by step, how to see the code with curl, how to calculate the cost of redirect chains, and which code to use when moving a site. The command outputs below were verified by running them against a local test server.

Five classes

ClassMeaning
1xxInformational
2xxSuccessful
3xxRedirection
4xxClient error (problem on the request side)
5xxServer error

The most common codes

Example 1: Seeing the code from the command line

Our test server was set up so that /yok returns 404, /hata 500 and /yeni 200. The command that prints only the code:

curl -s -o /dev/null -w '%{http_code}' http://127.0.0.1:8765/yok

Output: 404. The same command gave 500 for /hata and 200 for /yeni. To see the headers use curl -I address; in the headers of our maintenance page we saw the line HTTP/1.0 503 Service Unavailable (the first line of the header). In the browser, open the Network tab with F12 for the same information; the code is shown next to each request.

Example 2: Following a redirect

Say the /eski address is redirected to /yeni with a 301.

  1. curl -s -o /dev/null -w '%{http_code}' http://127.0.0.1:8765/eski → 301 (without following the redirect).
  2. curl -L -s -o /dev/null -w '%{http_code} %{num_redirects} %{url_effective}' http://127.0.0.1:8765/eski → 200 1 http://127.0.0.1:8765/yeni.

So with -L one redirect was followed and the final status was 200. A search engine bot likewise sees the 301 and records the new address.

Example 3: How much does a redirect chain slow things down?

Every redirect means a separate request-response round trip for the browser. Say one round trip takes 80 ms (hypothetical).

The longer the chain, the bigger the difference on mobile connections. The fix is to redirect all old addresses directly to the final destination.

Example 4: Counting 404s when moving a site

Say the site you are moving has 1,200 pages and the share you cannot match on the new site is 3% (hypothetical). 1,200 × 0.03 = 36 addresses are left without a match. If some of these receive external links, returning 404 wastes the link value. For these, give a 301 to the closest content; for those with no equivalent at all, deliberately leave a 404 or 410.

Example 5: Catching the code in Python

The call urllib.request.urlopen('http://127.0.0.1:8765/yok') raises an error for a 404; the error object's code attribute gives 404 (we saw this by running it against our test server). When you open /eski, on the other hand, the library follows the redirect automatically and the status attribute returns 200. This shows that in automated scripts the assumption "200 came back, so everything is fine" can be misleading because of redirects: look at how many redirects were made along with the final status.

Troubleshooting order

  1. Look at the first digit of the code: if it is 4, examine the address, permissions or request format; if it is 5, examine the server.
  2. If it is 3xx, follow the chain with curl -L and count how many steps it takes.
  3. If it is 404, check the spelling of the address, letter case and the trailing slash.
  4. If it is 403, examine file permissions and access rules.
  5. If it is 5xx, look at the server log; the error message is usually written there.
  6. If you made changes, test again while bypassing the browser cache.

What matters for SEO?

301, 302, 307, 308: which one?

CodePermanent?Method preserved?Typical use
301YesBrowsers may often change it to GETPermanent move
302NoBrowsers may often change it to GETTemporary redirect
307NoYesTemporary, POST must be preserved
308YesYesPermanent, POST must be preserved

Common mistakes

How do you see the status code?

Open the developer tools (F12) in the browser and look at the Network tab, or use curl -I. The page indexing report in Search Console also lists errors on your site.

For explanations of the codes see the HTTP Status Codes Dictionary tool. To split an address into parts the URL Parser helps, and for file types the MIME Type Finder. See also the guide URL Slug for address structure.

Frequently asked questions

What is the difference between 301 and 302?

301 is a permanent move; search engines index the new address and pass on link value. 302 is temporary; the old address may stay in the index. Use 301 for a permanent move.

What is a soft 404?

It is when the server returns 200 instead of 404 for a page that does not exist; search engines may treat the page as if it were real. Deleted pages should return a real 404 or 410.

What is the difference between 500 and 503?

500 reports an unexpected error on the server. 503 says the service is temporarily unavailable, and a Retry-After header can indicate when to try again.

Tools mentioned in this guide

More guides

This article is for general information only and is not legal, financial or medical advice. We are not an official institution.