IIS6 - Why won't my Custom error page display?

﹥>﹥吖頭↗ 提交于 2019-12-10 17:49:59

问题


I have a custom error page that should display for HTTP 404 errors. It does not and I am having difficulty figuring out why.

My web.config is set

<customErrors mode="On" />

Fiddler shows a 401.2, followed by a 404 for a single POST. Both errors should be custom. The 401.2 is working because I see it in fiddler. The 404 happens immediately after so all I see in the browser is the generic 404 error. I should see my custom 404 page.

Why won't my custom HTTP 404 page showup?


回答1:


What's the URL you are testing with? If it's not a file type handled by ASP.NET (e.g. /foo/bar.txt) then you won't see the ASP.NET defined 404 handler.

-Oisin




回答2:


If you're looking for what the 404.x codes mean here's this

HTTP 404.x-File or Directory Not Found

  • None - File or directory not found.
  • 1 - Web site not accessible on the requested port.
  • 2 - Web service extension lockdown policy prevents this request.
  • 3 - MIME map policy prevents this request.

Seems to be an IIS specific code, not sure if IIS sends these details with the response



来源:https://stackoverflow.com/questions/5748304/iis6-why-wont-my-custom-error-page-display

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!