定义错误文档(Error Documents )
只需要在程序目录下建立.htaccess文件,用记事本打开文件按下面代码范例填写相应URL即可。
ErrorDocument 400 /errors/badrequest.html #定义400为http根目录下/errors/badrequest.html
ErrorDocument 404
http://yoursite/errors/notfound.html #定义404文档为
http://yoursite/errors/notfound.htmlErrorDocument 401 “Authorization Required” #定义401文档直接显示Authorization Required
IE浏览器用户请关闭友好提示后查看效果。