404 does not append aspxerrorpath for non aspx pages

懵懂的女人 提交于 2019-12-11 05:50:01

问题


i am using ELMAH to log errors, it works fine for pages with aspx, i.e. eroordfs.aspx

but when it has a non aspx extension or no extension, my error page loads with no aspxerrorpath in the url, i think this is the reason that elmah is not logging the error.

i am using iis7.5

my web.config details are as follows:

<httpErrors errorMode="Custom">
            <remove statusCode="500" subStatusCode="-1" />
            <remove statusCode="404" subStatusCode="-1" />
            <error statusCode="404" subStatusCode="-1" prefixLanguageFilePath="" path="/404.aspx" responseMode="ExecuteURL" />
            <error statusCode="500" subStatusCode="-1" prefixLanguageFilePath="" path="/500.aspx" responseMode="ExecuteURL" />
        </httpErrors>

and

<customErrors mode="On">
      <error statusCode="404" redirect="~/404.aspx" />
      <error statusCode="500" redirect="~/500.aspx" />
    </customErrors>

thanks in advance for any advice you can offer

来源:https://stackoverflow.com/questions/11187609/404-does-not-append-aspxerrorpath-for-non-aspx-pages

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