0

I'm trying to create a custom error page for the 404.13 error (when a user tries to upload a file too large). What I want to be able to do is log information on the error (page name especially), but I can't seem to configure the IIS 7 error-handling properly.

I'm guessing in order to get this to work I need to use the "Execute a URL on this site" option in the custom error page setup... Here's how that looks in my web.config file:

<httpErrors errorMode="Custom">
    <error statusCode="404" subStatusCode="13" path="/ErrorPages/404-13.asp" responseMode="ExecuteURL" />
</httpErrors>

However, when I do this, I only get IE's "friendly" error message when my custom error is supposed to load:

Generic IE error - only shows with "ExecuteURL" method

I don't have this issue if I use either of the other two options: "Insert content from static file into the error response" or "Respond with a 302 redirect". But neither of those options seem to allow me to have the error-logging capabilities I need (one's static, the other loses error info in the redirect).

Any ideas on how to get responseMode="ExecuteURL" to work? Thanks in advance!

Extra Info

Here's my test custom error page (/ErrorPages/404-13.asp):

<%@ language="VBScript" %>
<html>
<head></head>
    <body>
        <div>
            Test: <%=Request.ServerVariables("SCRIPT_NAME")%><br />
            <%
            Set objASPError = Server.GetLastError
            Response.write "Code: " & objASPError.ASPCode
            %>
        </div>
    </body>
</html>

Edit

I should have also specified that I do have IIS configured to send errors to the browser. I only get this generic IE error when testing my custom error page in "ExecuteURL" mode.

justanotherguy
  • 506
  • 2
  • 4
  • 18
  • Have you specified in the ASP section IIS to "Send Errors to Browser" set to `True`? – user692942 May 07 '15 at 13:36
  • possible duplicate of [What is required for an IIS site to send error details to the browser?](http://stackoverflow.com/questions/6324801/what-is-required-for-an-iis-site-to-send-error-details-to-the-browser) – user692942 May 07 '15 at 13:39
  • Yes already already had that configured to send errors to browser... Again it's weird since it only gives me this issue with the "ExecuteURL" option but the other options work. – justanotherguy May 07 '15 at 14:03

0 Answers0