If you take a closer look at the HTTP status codes, there are quite a few, but the status codes that you usually see and need to deal with are limited, so remember them from the ones that are familiar to you.
What is written on this page
What is an HTTP status code in the first place?
Have you ever been unable to browse a website because a 3-digit number such as "404 Not Found" and an English sentence are displayed when you check the website using the Internet?
For example, when browsing a website, if you enter the URL in the address field of the browser and send it, the server (computer that provides the service) at the request destination says "Display the contents of the website in the browser". A response will be returned.
However, on rare occasions, you may not be able to view it for some reason, such as not being able to find the website you requested. At this time, the "HTTP status code" is a 3-digit number that clearly displays the result of whether the process is ongoing, completed normally, or an error has occurred.
Status code type
There are many types of status codes, from the 100s to the 500s.
I will mainly explain the 400s and 500s that are frequently used, but since there is no loss in knowing it, I will briefly touch on other numbers.
Status code in the 100s
The status code in the 100s isThe web server will give you a little more information, it will take a little longer to process, Is being returned.
For example, "102 Processing" has a status code of "Currently processing is continuing".
Status code in the 200s
The 200s areA state in which the process is successful and the response is normal.Means.
If the page is displayed correctly in the browser, most will return a status code of "200 OK".
When it is displayed normally without any problem, it is basically in the state of "200".
* However, as I will explain next, it may be transferred (redirected) at a level that you do not notice.
Status code in the 300s
The 300s areA state that requires additional processing to complete the requestMeans.
There are mainly "301 Moved Permanently" that transfers pages permanently and "302 Moved Temporarily" that transfers pages temporarily.
A 301 redirect means "Permanent Redirect" and is used to completely navigate a site or page.
It means that the relocation has been completed and you want to always refer to the relocation destination in the future.
- When moving the site by domain
- When moving only some pages on the site
- When used for URL normalization purposes and does not require users or search engines to see duplicate pages
- When forwarding a broken link page to another page
Is often used for.
When moving the entire domain or when moving only some pages, it means that the page or site will be moved to the specified URL and will not return to the original URL.
For the purpose of normalization, when the exact same content is displayed with or without www or with or without index.html, it is a case of redirecting from one side to the other side as a canonical URL. .. In such cases, it is appropriate to make a permanent transfer of 301, as you can always refer to the legitimate URL.
On the other hand, if products such as different colors are displayed with different URLs on "EC sites" such as online shopping, there is a high possibility that they will be treated as duplicate pages by search engines, and only one of them will be displayed in the search results. It often happens that normalization is needed to make it work.
However, if you do a 301 redirect, users will not be able to see products in different colors, so normalization in such cases is done with "caonical".
See also here.
For both search engines and users, remember to use 301 redirects for normalization in cases where you don't need to visit non-genuine pages.
302 Moved Temporarily
302 redirects are used for short periods of time, from a few days to a week.
Specific examples include when transitioning to the notification page displayed during site maintenance, or when the site is temporarily relocated due to a server error or the like. It is also often used when you want to display the page of a limited-time product as the main page for a short period of time.
By the way, I think that there are many methods to create a mobile site on a separate page and redirect to that page, but Google recommends redirecting to the mobile site with "302".
See also here for redirects.
304 Not Modified
The 304 error means "not updated", which means that the access itself is okay and the content of the target page (text, menus, images, etc.) has not been updated since the last visit.
When you receive this status, the content data will not be downloaded from the server. However, the cache in the browser when I accessed it last time is taken out and the content is displayed, and the process of downloading the content from the server is not performed. The web page will be displayed faster by that amount.
Status code in the 400s
The status code in the 400s mainly indicates the situation where the browser could not respond due to an error in the request.
Isn't it the "404 (meaning page not found)" error that you see most often?
The 401 error is an error that occurs when login fails, such as "basic authentication" before viewing the page. I tried to log in, but it means "authentication failed" because "permission was not given".
Make sure you have the correct ID and password.
A 403 error is an error that occurs when you do not have permission to view the page.
It means that you tried to view the page, but it was denied access because it was "banned". In many cases, it is often caused by a mistake on the part of the site administrator.
Viewers cannot solve the problem on their own, so wait for the administrator to respond, or check there if you can make inquiries.
404 Not Found (404 error)
A 404 error is an error that occurs when the page you visited does not exist.
Check carefully as the URL may be incorrect or you may have visited an old page.
However, this is also a part that the site administrator should be careful about on a daily basis, and since it is a big problem that leads to the withdrawal of visitors, the administrator side always carefully checks the status of the site. Let's keep it.
Soft 404 error
Since the status code itself is returned as "200", it is almost difficult for users to notice, but the site administrator should be careful.
In particular, please be aware that you may unknowingly cause a software 404 if you have a program that automatically generates pages for sales sites.
See also here for soft 404 errors.
Status code in the 500s
A status code in the 500s means that something is wrong with the server and the request cannot be answered.
In this case, contact your hosting company for an early response.
502 Bad Gateway
The 502 error is an error that occurs when something goes wrong with the server acting as the gateway. A gateway is, in a broad sense, a "connector between different nets." For example, you can connect to the Internet from a tablet device because it goes through a gateway.
Possible causes include server-side configuration errors and PHP version changes. However, this error is difficult to resolve immediately because the details are difficult to identify.
503 Service Unavailabl
The 503 error is an error that occurs when access is too concentrated or the server is temporarily unavailable due to maintenance.
In the first place, the rental server has restrictions on the amount of data transferred and access so as not to put an extra load on it.
It happens when the limit is exceeded. A common error is when a popular influencer advertises or when a tremendous amount of temporary traffic is concentrated on a news store site.
What is the original 404 page?
The original 404 page is the original 404 page for the user.
If nothing is set, the user will leave with an inorganic 404 page.
On the other hand, the original 404 page has a lead link to other pages and gives a good impression to the user with unique images and texts.
example)Honda 404 page
Honda's 404 page is not only very easy to use, but also has a form saying "Please tell us which page was 404". By receiving an error report, the company can respond quickly.
Basically, if an error status code occurs, there are many things that the administrator should handle. It is very likely that the users who have visited the site will be removed, so it is important for the site administrators to check the sites that they manage on a daily basis. is.