# egrep -i \^errordocument /etc/httpd/conf/httpd.conf
ErrorDocument 404 /hello.html
# apachectl restart
- status code 404 をかえし、そのレスポンス内に返すオブジェクトもかえす
Hypertext Transfer Protocol
HTTP/1.1 404 Not Found\r\n
Request Version: HTTP/1.1
Response Code: 404
Date: Mon, 12 Apr 2010 11:04:08 GMT\r\n
Server: Apache/2.2.3 (CentOS)\r\n
Last-Modified: Mon, 12 Apr 2010 10:58:53 GMT\r\n
ETag: "4cc975-6-7d75540"\r\n
Accept-Ranges: bytes\r\n
Content-Length: 6\r\n
[Content length: 6]
Connection: close\r\n
Content-Type: text/html; charset=UTF-8\r\n
\r\n
Line-based text data: text/html
hello\n <- 返すオブジェクトの内容 ( hello )
- client の URLリクエスト部は変わらない
Hypertext Transfer Protocol
GET /no_object HTTP/1.1\r\n
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.