In addition to 404, what other "codes" are there for web pages?

In addition to 404, what other "codes" are there for web pages?

404 Not Found

When surfing the Internet, whether it's "the webpage is lost" or "the webpage is flying into space on a rocket", the page has a mysterious number "404".

I believe that most people are familiar with 404. Once it appears, it means that the page we want to access cannot be found.

[[420271]]

So, what exactly is 404? And what causes 404 to occur?

In fact, 404 is the HTTP (Hyper Text Transfer Protocol) status code issued by the web server when it cannot find the document requested by the user. The 404 page appears to remind the user that an error has occurred on the web page. The reasons for this error may be:

  • The web page data has been changed, or the file directory/file name uploaded to the web page has been changed, causing the web page to become invalid.
  • The web page file has been moved or deleted, causing the original link to become invalid.
  • The URL we entered ourselves was wrong and could not link to the required file.
  • You haven't plugged in an Ethernet cable or your home Wi-Fi signal is too poor.

In short, 404 is a signal from the web page that "this road is blocked".

502 Bad Gateway

In addition to 404, there is another most common HTTP status code - 502. When a certain website was inaccessible before, netizens spoke out: At first, the page showed 404 and thought it was their fault, but later it showed 502, and they were relieved to know it was not their fault.

[[420272]]

Because the 502 code indicates an internal network failure or configuration problem, i.e. internal network congestion.

Usually when there are a large number of data calls or interactions within the network, one or two servers of the web page content provider cannot operate normally due to performance defects or program errors, making it impossible for the content on the web page to be transmitted to the user's browser.

In layman's terms, the server crashed and the website was down. This is very common when buying tickets or when a hot event breaks out. At this time, all we can do is refresh the web page, reopen the page, and wait patiently. As we can see, the two HTTP status codes 404 and 502 are very different in nature. Let's continue to learn about other HTTP status codes.

HTTP Status Codes

The Hypertext Transfer Protocol (HTTP) itself is a simple request-response protocol that specifies the information transmission specifications between the web server and the browser. The HTTP status code (HTTP Status Code) is part of the web server's response information and is a 3-digit code used to indicate the status of the Hypertext Transfer Protocol response.

When you visit a web page, the browser sends a request to the server where the web page is located. After the server where the web page is located receives and interprets the request message, it returns a response message containing an HTTP status code to respond to the browser's request.

When we visit a web page, the server will convey simple information to us through the HTTP status code. The status code can indicate whether the specific request has been successful or reveal the exact reason why the request failed.

Common status codes

The HTTP status code is recorded in the server log and may also be displayed on the client. It is the error message code displayed by the browser when an error occurs when opening the page, such as 404 or 502.

The first digit of the status code represents the status of the server response. There are currently 5 common response statuses.

In addition to the 404 and 502 mentioned above, the following 9 common status codes should give you a more intuitive understanding of status codes.

(1) 100 Continue

The client has received part of the request and is ready to receive the rest. The requester needs to continue making requests.

[[420274]]

(2) 200 OK (request successful)

The server has successfully processed the request and the web page (or the requested file) can be opened normally.

[[420275]]

(3) 206 Partial Content

The server successfully processed some GET requests. HTTP download tools (such as Xunlei) use this type of response to resume downloads or to split a large document into multiple download segments for simultaneous download.

[[420276]]

(4) 301 Moved Permanently

The requested resource has been permanently moved to a new location. The response will include a new URI (Uniform Resource Identifier), and the browser will automatically be directed to the new URI. Any future requests for this resource should use the new URI instead.

[[420277]]

(5) 302 Found

The server asks the client to perform a temporary redirect (the original description phrase is "Moved Temporarily"). The server temporarily responds to the request from a web page in a different location, but such a redirection is temporary, and the client should still send subsequent requests to the original address.

[[420278]]

(6) 400 Bad Request

The server returns a 400 error code to tell the client that the client's request syntax is incorrect and the server cannot understand it.

[[420279]]

(7) 401 Unauthorized

The server requires the client to authenticate, and incorrect login attempts are the main cause of this error.

[[420280]]

(8) 403 Forbidden (Access Denied)

The server understood your request but is refusing to execute it. No login will work for a 403 error, which occurs when you try to access a forbidden directory on a website.

[[420281]]

(9) 500 Internal Server Error

An error within the server caused the request to fail. Generally speaking, this may be due to an error in the server's program code. For example, if the web server is overloaded, it will not be able to process access requests correctly.

[[420282]]

In short, we don't need to care about status codes starting with 1, 2, and 3, but we just need to pay a little attention to those starting with 4 and 5.

<<:  Network Interview Experience: It’s time to learn about these new features of HTTP 2.0

>>:  Operators' mid-term performance is impressive, and 5G development has entered a critical moment

Recommend

SKT launches online-only plans for 5G and 4G customers

South Korean telecom operator SK Telecom recently...

Why do we need 5G-A?

In today's article, I want to talk to you abo...

After 5G entered the market, the driving effect began to emerge

On September 21, the three major operators releas...

8 essential skills for network engineers in 2017

The current average job responsibilities of a net...

Let’s talk about 5G this year

Time is like quicksand, and the 2010s are about t...

Cutover failure leads to major communication failure

[[429302]] Japan has once again experienced a maj...