G
Guest
Hi!
I tried to implement custom error pages using the <customErrors> directive
in a web.config file. It worked fine for "simple" errors like HTTP 404, like
this example:
<customErrors mode="On">
<error statusCode="404"
redirect="http://localhost/ErrorPages/Error404.aspx"/>
</customErrors>
My problem is: I wanted to do that for errors like HTTP 401 (Unauthorized)
as well. But those errors come with additional IIS status codes, e.g. HTTP
401.2 (Unauthorized: Access is denied due to server configuration). So, how
can I target such an error with the aforementioned customErrors directive? I
already tried to enter values like "401.2", "401;2", "401-2", but the
statusCode attribute only accepts integer values. "4012", or just "401" (one
page for all IIS status codes) didn't work as well.
I would really like to use this method, and no "workarounds" like using the
Application_Error event in global.asax.
--
Daniel Kopp
MCP
HUENGSBERG AG
Lilienthalstr. 29
D-85399 Hallbergmoos
I tried to implement custom error pages using the <customErrors> directive
in a web.config file. It worked fine for "simple" errors like HTTP 404, like
this example:
<customErrors mode="On">
<error statusCode="404"
redirect="http://localhost/ErrorPages/Error404.aspx"/>
</customErrors>
My problem is: I wanted to do that for errors like HTTP 401 (Unauthorized)
as well. But those errors come with additional IIS status codes, e.g. HTTP
401.2 (Unauthorized: Access is denied due to server configuration). So, how
can I target such an error with the aforementioned customErrors directive? I
already tried to enter values like "401.2", "401;2", "401-2", but the
statusCode attribute only accepts integer values. "4012", or just "401" (one
page for all IIS status codes) didn't work as well.
I would really like to use this method, and no "workarounds" like using the
Application_Error event in global.asax.
--
Daniel Kopp
MCP
HUENGSBERG AG
Lilienthalstr. 29
D-85399 Hallbergmoos