I've just noticed in my logs that if there is a "." at the end of the url that doesn't exist on a .net 4 i开发者_StackOverflow中文版ntegrated apppool, iis 7.5 does not display your preset 404 url but default not found page.
I have my custom 404 url on both iis and asp.net settings. it works just fine with any other url that doesn't exist.
Site uses .net 4 routing with asp.net webforms. As far as i know it is nothing to do with routing beacuse even if i try a random url like "site.com/djfdhfhgfhgfggfff." behavior doesn't change.
Anyone experienced something like this?
Eror looks like coming from asp.net. it reads
Server Error in '/' Application.
The resource cannot be found.
Description: HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable. Please review the following URL and make sure that it is spelled correctly.
Requested URL: /etc.
update: just done a trace logging and looks like global.asax throwing it.
MODULE_SET_RESPONSE_ERROR_STATUS
ModuleName global.asax
Notification 1
HttpStatus 404
HttpReason Not Found
HttpSubStatus 0
ErrorCode 0
ConfigExceptionInfo
Notification BEGIN_REQUEST
ErrorCode The operation completed successfully. (0x0)
Basically your are getting a 404 code from ASP.NET instead of IIS. A simple fix would be to tell asp.net to use your custom page for 404 errors through the section in your web.config. See the example in this link ... http://msdn.microsoft.com/en-us/library/h0hfz6fc.aspx
精彩评论