A complete list of HTTP status codes

 

1. HTTP Status Code

 

If a request is made to your server to display a page on your site (for example, when a user visits your page through a browser or when Googlebot crawls the page), the server returns an HTTP status code in response to the request.

 

This status code provides information about the status of the request, telling Googlebot about your site and the requested page.

Some common status codes include:

  • 200  – The server successfully returned the page
  • 404  - The requested page does not exist
  • 503  – The server is temporarily unavailable

 

A complete list of HTTP status codes is provided below. Click the link to learn more. You can also visit the W3C webpage on HTTP status codes  for more information .

 

1xx: Request received, continue processing
2xx: Operation successfully received, parsed, accepted
3xx: To complete this request further processing must be done
4xx: The request contained an incorrect syntax or could not be completed
5xx: The server failed to execute a fully valid request



1xx (Provisional Response)
status codes that indicate a provisional response and require the requester to continue with the action.

 

 

code description

100 (continued) The requester should proceed with the request. The server returns this code to indicate that the first part of the request has been received and is waiting for the rest.
101 (Switching Protocol) The requester has asked the server to switch protocols, the server has confirmed and is ready to switch.

 

 

2xx (success)

A status code indicating that the server successfully processed the request.

 

 

code description

200 (success) The server has successfully processed the request. Typically, this means that the server served the requested web page. If this status is displayed for your robots.txt file, it means that Googlebot has successfully retrieved the file.
201 (created) The request was successful and the server created a new resource.
202 (accepted) The server has accepted the request but has not yet processed it.
203 (unauthorized information) The server has successfully processed the request, but the returned information may have come from another source.
204 (no content) The server successfully processed the request, but returned nothing.
205 (reset content) The server successfully processed the request, but returned nothing. Unlike the 204 response, this response requires the requester to reset the document view (eg, clear the form content to enter new content).
206 (partial content) The server successfully processed part of the GET request.

 

 

3xx (redirect)
To complete the request, further action is required. Typically, these status codes are used for redirection. Google recommends that you use no more than 5 redirects per request. You can use Webmaster Tools to see if Googlebot is having trouble crawling redirected pages. The Web Crawl page under Diagnostics lists URLs that Googlebot could not crawl due to redirect errors.

 

 

code description

300 (many options) In response to the request, the server can perform various operations. The server can choose an action based on the requestor (user agent), or provide a list of actions for the requester to choose from.
301 (Moved Permanently) The requested webpage has been permanently moved to a new location. When the server returns this response (to a GET or HEAD request), it automatically redirects the requester to the new location. You should use this code to tell Googlebot that a page or site has been permanently moved to a new location.
302 (move temporarily) The server is currently responding to requests from pages in a different location, but the requester should continue to use the original location for future requests. This code is similar to the 301 code in response to a GET or HEAD request and will automatically send the requester to a different location, but you should not use this code to tell Googlebot that a page or site has moved because Googlebot will continue to crawl the original location and index.
303 (see other locations) The server returns this code when the requester should use separate GET requests for different locations to retrieve the response. For all requests except HEAD, the server automatically goes elsewhere.
304 (unmodified) 自从上次请求后,请求的网页未修改过。服务器返回此响应时,不会返回网页内容。如果网页自请求者上次请求后再也没有更改过,您应当将服务器配置为返回此响应(称为 If-Modified-Since HTTP 标头)。 由于服务器可以告诉 Googlebot 自从上次抓取后网页没有更改过,因此可节省带宽和开销

305(使用代理) 请求者只能使用代理访问请求的网页。 如果服务器返回此响应,还表示请求者应使用代理。
307(暂时重定向) 服 务器目前从不同位置的网页响应请求,但请求者应继续使用原有位置来进行以后的请求。 此代码与响应 GET 和 HEAD 请求的 301 代码类似,会自动将请求者转到不同的位置,但您不应使用此代码来告诉 Googlebot 某个页面或网站已经移动,因为 Googlebot 会继续抓取原有位置并编入索引。

 

 

4xx(请求错误)
这些状态代码表示请求可能出错,妨碍了服务器的处理。

 

 

代码 说明

400(错误请求) 服务器不理解请求的语法。
401(未授权) 请求要求身份验证。 对于需要登录的网页,服务器可能返回此响应。
403(禁止) 服务器拒绝请求。 如果您看到 Googlebot 在尝试抓取您网站上的有效网页时收到此状态代码(可以在 Google 网站管理员工具诊 断下的网络抓取页面上看到此信息),可能是您的服务器或主机拒绝 Googlebot 访问。
404(未找到) 服务器找不到请求的网页。 例如,如果请求服务器上不存在的网页,服务器通常会返回此代码。如果您的网站上没有 robots.txt 文件,而您在 Google 网站管理员工具”诊断”标签的 robots.txt 页上看到此状态,那么这是正确的状态。 但是,如果您有 robots.txt 文件而又看到此状态,则说明您的 robots.txt 文件可能命名错误或位于错误的位置 (该文件应当位于顶级域名,名为 robots.txt)。

如果您看到有关 Googlebot 尝试抓取的网址的此状态(在”诊断”标签的 HTTP 错误页上),则表示 Googlebot 追踪的可能是另一个页面的无效链接(是旧链接或输入有误的链接)。

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 协议版本。

 

 

英文版:

100:Continue
101:Switching Protocols
102:Processing

200:OK
201:Created
202:Accepted
203:Non-Authoriative Information
204:No Content
205:Reset Content
206:Partial Content
207:Multi-Status

300:Multiple Choices
301:Moved Permanently
302:Found
303:See Other
304:Not Modified
305:Use Proxy
306:(Unused)
307:Temporary Redirect

400:Bad Request
401:Unauthorized
402:Payment Granted
403:Forbidden
404:File Not Found
405:Method Not Allowed
406:Not Acceptable
407:Proxy Authentication Required
408:Request Time-out
409:Conflict
410:Gone
411:Length Required
412:Precondition Failed
413:Request Entity Too Large
414:Request-URI Too Large
415:Unsupported Media Type
416:Requested range not satisfiable
417:Expectation Failed
422:Unprocessable Entity
423:Locked
424:Failed Dependency

500:Internal Server Error
501:Not Implemented
502:Bad Gateway
503:Service Unavailable
504:Gateway Timeout
505:HTTP Version Not Supported
507:Insufficient Storage

200号状态码

220.181.32.30 - - [02/Sep/2008:00:01:23 +0800] "GET /article/0572/72570.shtml HTTP/1.1" 200 28361 "-" "Baiduspider+(+http://www.baidu.com/search/spider.htm)"

服务器日志中的200表示使用GET传递方式网页72570.shtml下载成功。即:当用户或爬虫程序向网站服务器发出浏览请求时,服务器返回 HTTP 数据流里包含某种状态码,200响应号即状态码中的一种,表示本网页被成功下载。

301号状态码

220.181.32.30 - - [02/Sep/2008:00:01:31 +0800] "GET /my/view.php?aid=14183 HTTP/1.1" 301 - "-" "Baiduspider+(+http://www.baidu.com/search/spider.htm)"

服务器日志中的301表示使用GET传递方式动态网页aid=14183成功跳转。即:当用户或爬虫程序向网站服务器发出浏览请求时,服务器返回 HTTP 数据流包含某种状态码,301 重定向即状态码中的一种,表示本网页永久性转移到另一个地址。实际操作中我们可以将多个域名指向同一个网址,这也是搜索引擎唯一认可的一种网站转向的方式。

 

 

二、404状态码

 

220.181.32.30 - - [02/Sep/2008:00:01:51 +0800] "GET /writing HTTP/1.1" 404 4459 "-" "Baiduspider+(+http://www.baidu.com/search/spider.htm)"

 

出现404状态码就证明有URL地址的网页浏览不到。很多时候由于网站的改版,使很多旧版网站url地址失效。这是你需要建立404状态页来保证你网站通畅,能够达到一种回路的效果。切记404状态页需要单独设计,不能直接在服务器端直接跳转回首页。否则,搜索引擎会大量抓取网站首页失误当成404页处理。

 

对HTTP404状态码的深度理解

 

HTTP 404 错误意味着链接指向的网页不存在,即原始网页的URL失效,这种情况经常会发生,很难避免,比如说:网页URL生成规则改变、网页文件更名或移动位置、导入链接拼写错误等,导致原来的URL地址无法访问;当Web 服务器接到类似请求时,会返回一个404 状态码,告诉浏览器要请求的资源并不存在。但是,Web服务器默认的404错误页面,无论Apache还是IIS,均十分简陋、呆板且对用户不友好,无法给用户提供必要的信息以获取更多线索,无疑这会造成用户的流失。

 

因此,很多网站均使用自定义404错误的方式以提供用户体验避免用户流失。一般而言,自定义404页面通用的做法是在页面中放置网站快速导航链接、搜索框以及网站提供的特色服务,这样可以有效的帮助用户访问站点并获取需要的信息。

HTTP404对SEO的影响

 

自定义404错误页面是提供用户体验的很好的做法,但在应用过程中往往并未注意到对搜索引擎的影响,譬如:错误的服务器端配置导致返回“200”状态码或自定义404错误页面使用Meta Refresh导致返回“302”状态码。正确设置的自定义404错误页面,不仅应当能够正确地显示,同时,应该返回“404”错误代码,而不是“200”或“302”。虽然对访问的用户而言,HTTP状态码究竟是“404”还是“200”来说并没有什么区别,但对搜索引擎而言,这则是相当重要的。

 

1.自定义404错误页返回“200”状态码

 

当搜索引擎蜘蛛在请求某个URL地址得到“404”状态回应时,即知道该URL地址已经失效,便不再索引该网页,并向数据中心反馈将该URL地址表示的网页从索引数据库中删除,当然,删除过程有可能需要很长时间;而当搜索引擎得到“200”状态回应时,则会认为该url地址是有效的,便会去索引,并会将其收录到索引数据库,这样的结果便是这两个不同的url地址具有完全相同的内容:自定义404错误页面的内容,这会导致出现复制网页问题。对搜索引擎而言,特别是Google,不但很难获得信任指数TrustRank,也会大大降低Google对网站质量的评定。

 

在使用Google Sitemap,当提交XML格式网站地图文件时,谷歌管理员工具会验证网站的身份以确保是网站合法的管理者。验证方式有两种:上传指定名称的html页到网站根目录或者在网页meta区域添加一个标识身份的meta标签。通常是使用上传html网页的方式,但谷歌管理员工具却提示网站根目录下找不到这个网页,这是一个很可怕的问题。

 

 

2.自定义404错误页使用Meta Refresh返回“302”状态码

 

常常看到许多网站的自定义404错误页面采取类似这样的形式:首先显示一段错误信息,然后,通过Meta Refresh将页面跳转到网站首页、网页地图或其他类似页。根据具体实现方式不同,这类404页面可能返回“200”状态码,也可能返回“302”,但不论哪种,从SEO技术角度看,均不是一种合适的选择。

 

对“200”状态的情况我们上面已经谈过,那么,当404页面返回“302”时,搜索引擎会怎么对待呢?从理论上说,对“302”错误,搜索引擎认为该网页是存在的,只不过临时改变了地址,仍然会索引收录该页,这样,同样会出现类似于“200”状态码时的重复文本问题;其次,以谷歌为代表的主流搜索引擎对302重定向的适用范围要求越来越严格,这类不当使用302重定向的情况存在很大的风险。

 

确保自定义404错误页面能够返回“404”状态码

 

在自定义404错误页面设置完毕后,一定要检查一下其是不是能够正确地返回“404”状态码。可以使用Server Header检查工具,输入一个不存在网页的url,查看一下HTTP Header的返回情况,确信其返回的是“404 Not found”。

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=327070074&siteId=291194637