要创建的基本 .htaccess 错误页面是什么?

What are the essential .htaccess error pages to create?

我知道 404 页面是必不可少的,但是开发人员应该为哪些其他最常见的错误创建错误页面?

这是一个包含客户端错误和服务器错误的列表。

http://en.wikipedia.org/wiki/List_of_HTTP_status_codes#4xx_Client_Error

http://en.wikipedia.org/wiki/List_of_HTTP_status_codes#5xx_Server_Error

我会为这些特定的错误代码创建一个页面,因为它们很常见:

400 Bad Request
401 Unauthorized
403 Forbidden
404 Not Found
500 Internal Server Error
503 Service Unavailable

然后为可能导致同一页面的所有其余错误代码使用 ErrorDocument 指令。这是为了防止您希望为所有错误代码创建一个自定义错误页面。