做網站的站長避免不了要接觸各種http狀態碼,為了讓大家對各種http狀態代碼更加了解,本文就各種http狀態代碼進行詳解,希望對大家有幫助。
1xx(臨時響應)
用于表示臨時響應并需要請求者執行操作才能繼續的狀態代碼。
100(繼續) 請求者應當繼續提出請求。服務器返回此代碼則意味著,服務器已收到了請求的第一部分,現正在等待接收其余部分。
101(切換協議) 請求者已要求服務器切換協議,服務器已確認并準備進行切換。
2xx(成功)
用于表示服務器已成功處理了請求的狀態代碼。
200(成功) 服務器已成功處理了請求。通常,這表示服務器提供了請求的網頁。如果您的 robots.txt 文件顯示為此狀態,那么,這表示 搜索引擎蜘蛛 已成功檢索到該文件。
201(已創建) 請求成功且服務器已創建了新的資源。
202(已接受) 服務器已接受了請求,但尚未對其進行處理。
203(非授權信息) 服務器已成功處理了請求,但返回了可能來自另一來源的信息。
204(無內容) 服務器成功處理了請求,但未返回任何內容。
205(重置內容) 服務器成功處理了請求,但未返回任何內容。與 204 響應不同,此響應要求請求者重置文檔視圖(例如清除表單內容以輸入新內容)。
206(部分內容) 服務器成功處理了部分 GET 請求。
3xx(已重定向)
向錯誤而無法抓取的網址。
300(多種選擇) 服務器根據請求可執行多種操作。服務器可根據請求者 (User agent) 來選擇一項操作,或提供操作列表供請求者選擇。
301(永久移動) 請求的網頁已被永久移動到新位置。服務器返回此響應(作為對 GET 或 HEAD 請求的響應)時,會自動將請求者轉到新位置。您應使用此代碼通知 搜索引擎蜘蛛
某個網頁或網站已被永久移動到新位置。
302(臨時移動) 服務器目前正從不同位置的網頁響應請求,但請求者應繼續使用原有位置來進行以后的請求。此代碼與響應 GET 和 HEAD 請求的 301 代碼類似,會自動將請求
者轉到不同的位置。但由于 搜索引擎蜘蛛 會繼續抓取原有位置并將其編入索引,因此您不應使用此代碼來通知 搜索引擎蜘蛛 某個頁面或網站已被移動。
303(查看其他位置) 當請求者應對不同的位置進行單獨的 GET 請求以檢索響應時,服務器會返回此代碼。對于除 HEAD 請求之外的所有請求,服務器會自動轉到其他位置。
304(未修改) 自從上次請求后,請求的網頁未被修改過。服務器返回此響應時,不會返回網頁內容。
如果網頁自請求者上次請求后再也沒有更改過,您應當將服務器配置為返回此響應(稱為 If-Modified-Since HTTP 標頭)。由于服務器可以告訴 搜索引擎蜘蛛 自從上次抓取后網頁沒有更改過,因此可節省帶寬和開銷
305(使用代理) 請求者只能使用代理訪問請求的網頁。如果服務器返回此響應,那么,服務器還會指明請求者應當使用的代理。
307(臨時重定向) 服務器目前正從不同位置的網頁響應請求,但請求者應繼續使用原有位置來進行以后的請求。此代碼與響應 GET 和 HEAD 請求的 301 代碼類似,會自動將請
求者轉到不同的位置。但由于 搜索引擎蜘蛛 會繼續抓取原有位置并將其編入索引,因此您不應使用此代碼來通知 搜索引擎蜘蛛 某個頁面或網站已被移動。
4xx(請求錯誤)
這些狀態代碼表示,請求可能出錯,已妨礙了服務器對請求的處理。
400(錯誤請求) 服務器不理解請求的語法。
401(未授權) 請求要求進行身份驗證。登錄后,服務器可能會返回對頁面的此響應。
403(已禁止) 服務器拒絕請求。如果在 搜索引擎蜘蛛 嘗試抓取您網站上的有效網頁時顯示此狀態代碼(您可在 Google 網站管理員工具中診斷下的網絡抓取頁面上看到此狀態代碼),那么,這可能是您的服務器或主機拒絕 搜索引擎蜘蛛 對其進行訪問。
404(未找到) 服務器找不到請求的網頁。例如,如果請求是針對服務器上不存在的網頁進行的,那么,服務器通常會返回此代碼。
如果您的網站上沒有 robots.txt 文件,那么,這是正確的狀態。然而,如果您有 robots.txt 文件而又發現了此狀態,那么,這說明您的 robots.txt 文件可能是命名錯誤或位于錯誤的位置。(該文件應當位于頂級域名上,且應當名為 robots.txt)。
如果您在 搜索引擎蜘蛛 嘗試抓取的網址上發現此狀態(位于”診斷”標簽的 HTTP 錯誤頁上),那么,這表示 搜索引擎蜘蛛 所追蹤的可能是另一網頁中的無效鏈接(舊鏈接或輸入有誤的鏈接)。
405(方法禁用) 禁用請求中所指定的方法。
406(不接受) 無法使用請求的內容特性來響應請求的網頁。
407(需要代理授權) 此狀態代碼與 401(未授權)類似,但卻指定了請求者應當使用代理進行授權。如果服務器返回此響應,那么,服務器還會指明請求者應當使用的代理。
408(請求超時) 服務器等候請求時超時。
409(沖突) 服務器在完成請求時發生沖突。服務器必須包含有關響應中所發生的沖突的信息。服務器在響應與前一個請求相沖突的 PUT 請求時可能會返回此代碼,同時會提供兩個請求的差異列表。
410(已刪除) 如果請求的資源已被永久刪除,那么,服務器會返回此響應。該代碼與 404(未找到)代碼類似,但在資源以前有但現在已經不復存在的情況下,有時會替代 404代碼出現。如果資源已被永久刪除,那么,您應當使用 301 代碼指定該資源的新位置。
411(需要有效長度) 服務器不會接受包含無效內容長度標頭字段的請求。
412(未滿足前提條件) 服務器未滿足請求者在請求中設置的其中一個前提條件。
413(請求實體過大) 服務器無法處理請求,因為請求實體過大,已超出服務器的處理能力。
414(請求的 URI 過長) 請求的 URI(通常為網址)過長,服務器無法進行處理。
415(不支持的媒體類型) 請求的格式不受請求頁面的支持。
416(請求范圍不符合要求) 如果請求是針對網頁的無效范圍進行的,那么,服務器會返回此狀態代碼。
417(未滿足期望值) 服務器未滿足”期望”請求標頭字段的要求。
5xx(服務器錯誤)
這些狀態代碼表示,服務器在嘗試處理請求時發生內部錯誤。這些錯誤可能是服務器本身的錯誤,而不是請求出錯。
500(服務器內部錯誤) 服務器遇到錯誤,無法完成請求。
501(尚未實施) 服務器不具備完成請求的功能。例如,當服務器無法識別請求方法時,服務器可能會返回此代碼。
502(錯誤網關) 服務器作為網關或代理,從上游服務器收到了無效的響應。
503(服務不可用) 目前無法使用服務器(由于超載或進行停機維護)。通常,這只是一種暫時的狀態。
504(網關超時) 服務器作為網關或代理,未及時從上游服務器接收請求。
505(HTTP 版本不受支持) 服務器不支持請求中所使用的 HTTP 協議版本。
Web site owners to avoid exposure to various HTTP status code, in order to let everyone on the HTTP status code is more understanding, this paper detailed explanation of the HTTP status code.
1XX ( temporary response )
Used to indicate temporary response and request the execution operation to continue the status code.
100 ( Continued ) the requester shall continue to request. The server returns this code means, the server has received a request to the first part, we are waiting to receive the remainder.
101 ( Protocol ) the requester has asked the server protocol server has been confirmed, and prepare to switch.
2XX ( success)
Used to express server successfully processed the request status code.
200 ( success) server has been successfully processed the request. Usually, the said server provides the requested webpage. If your robots.txt file is displayed for this state, then, that the search engine spiders have been successfully retrieved the document.
201 ( created ) the request was successful and the server has created new resources.
202 ( accepted) server has accepted the request, but not for its treatment.
203 (unauthorized information ) server has been successfully processed the request, but returned may come from another source of information.
204 ( no content ) server successfully processed the request, but did not return any content.
205 ( reset content ) server successfully processed the request, but did not return any content. With 204 different response in response to the request, the request to reset the document view (such as removing the content of the form to enter new content ).
( Part 206 ) server successfully dealt with a portion of the GET request.
3xx ( redirected )
To mistake to crawl url.
300 ( multiple choice ) by the server can perform multiple operations. Server according to the requester ( User agent ) to select an operation, or operation list for a requester selects.
301 ( moved permanently ) request webpage has been permanently moved to a new location. The server returns the response ( as on GET or HEAD request response ), and will request to a new location. You should use this code notification of a search engine spider
A webpage or website has been permanently moved to a new location.
302 ( Temporary Mobile ) server is different from the position of the webpage in response to the request, the request should continue to use the original location for future requests. This code and the response of GET and HEAD request to the 301 code is similar, and will request
People go to a different location. But as a result of the search engine spiders will continue to capture the original position and the indexed, so you should not use this code to tell the search engine spiders a page or site has been moved.
303 ( see other position ) when the request to a different position was a separate GET request to retrieve a response, the server will return this code. In addition to the HEAD request for all but the request, the server automatically transferred to other locations.
304 ( unmodified) since the last request, request webpage has not been modified. The server returns the response, not return webpage content.
If the requester webpage since last request and never changed, you should configure the server to return the response ( known as If-Modified-Since HTTP header ). Because the server can tell the search engine spiders crawl after have changed since the last webpage, thus can save bandwidth and cost
305 ( proxy ) the requester can only use the proxy access request webpage. If the server returns the response, then the server will indicate the request, should use the proxy.
307 ( temporary redirect ) server is different from the position of the webpage in response to the request, the request should continue to use the original location for future requests. This code and the response of GET and HEAD request to the 301 code is similar, will automatically be please
Ask the person to a different location. But as a result of the search engine spiders will continue to capture the original position and the indexed, so you should not use this code to tell the search engine spiders a page or site has been moved.
4xx ( request error )
The status code indicates, the request may go wrong, has been hampered by the server to request processing.
400 ( error request server does not understand the grammar request ).
401 ( unauthorized ) request for authentication. After login, the server may return to the page of this response.
403 ( banned ) server refused request. If the search engine spider trying to crawl your site effective webpage show this status code ( you can be in the Google webmaster tools in the diagnosis of Web crawl page to see the status code ), then, this may be your server or host refused to search engine spiders of their visit.
404 ( not found) server could not find the requested webpage. For example, if the request is directed to the server doesn’t exist on the webpage of the, then, the server will typically return this code.
If you are not on site robots.txt files, so, this is the correct state. However, if you have a robots.txt file and found this state, so, this shows your robots.txt files may be naming errors or is in the wrong position. ( the file should be located in the top-level domain name, and shall be called robots.txt ).
If you are in a search engine spider trying to grab the website, discover this state (in the” diagnosis” label HTTP error page ), then, this means a search engine spider by tracking may be another webpage of invalid link ( old links or input error link).
405 ( method to disable disable ) specified in the request method.
406 ( not acceptable) cannot use the requested content characteristics in response to a request of the webpage.
407 ( need authorized agent ) this status code and 401 ( unauthorized ) is similar, but specifies a request should use the proxy authorization. If the server returns the response, then the server will indicate the request, should use the proxy.
408 ( request timeout ) server request timeout waiting for.
409 ( conflict ) server completes the request conflicts. The server must contain information about the response of the conflict between information. The server in response and a previous request conflicts with the PUT request may return this code, at the same time provide a two request to the difference list.
410 ( deleted ) if the requested resource has been permanently removed, then, the server will return the response. The code and 404 ( not found) code is similar, but the resources used to have but now no longer exists, sometimes replaced the 404 code appears. If the resource has been permanently removed, then, you should use a 301 code specifies that the resources of the new position.
411 (the need for effective length ) the server will not accept contains invalid Content-Length header field request.
412 (not to meet the prerequisite ) server does not satisfy the request in the request is set in one of the preconditions.
413 ( request entity too large ) server cannot process the request, because the request entity too large, has exceeded the processing power of the server.
414 ( URI request request too long ) URI ( usually for the URL ) is too long, the server can not be processed.
415 ( unsupported media type ) request format from the requested page support.
416 ( request scope does not meet the requirements of ) if the request is directed to webpage invalid was, then, the server will return the status code.
417 ( unmet expectations) server does not meet the” expectations” request-header field requirements.
5xx ( error )
The status code indicates, in attempt to handle the request server internal error. These errors may be the server itself is wrong, not request error.
500 ( internal server error the server encountered an error ), was unable to complete your request.
501 ( not implemented ) the server does not have to complete the requested function. For example, when the server is unable to identify the request method, the server may return this code.
502 ( error gateway ) server as a gateway or proxy, upstream from the server received an invalid response.
503 ( service not available ) is currently unavailable the server ( due to overloading or downtime for maintenance ). Usually, this is a temporary state.
504 ( Gateway timeout ) server as a gateway or proxy, not timely from the upstream server receives the request.
505 ( HTTP version is not supported ) the server does not support the request by the use of the HTTP protocol version.