473,506 Members | 16,201 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Custom error pages for HTTP errors with IIS status codes

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
Nov 19 '05 #1
0 1473

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
2242
by: Mark Aurit | last post by:
I have an intranet application that uses w2k Integrated Windows Authentication to authenticate users. We now have a situation where people will be accessing it who are on our network but will not...
14
3813
by: sinister | last post by:
I have some CGI programs that spit out error pages when the user enters illegal form input. These custom error pages, while informing the user of errors, are otherwise just standard web pages. ...
2
1817
by: ninja_kornjaca | last post by:
Hello, I'm having a pretty strange problem and I'd appreciate if anyone could help me with it. I'm having a custom error page on my IIS. Specifically, I've written my own ASP (classic ASP)...
6
2824
by: Nick Horrocks | last post by:
I have set up a custom error page for 404 errors. However the HTTP status code returned is 302 followed by 200, this causes search engines not to remove old pages from their index. How can I...
2
320
by: JJ | last post by:
I have seen many examples to set custom error pages as follows: <customErrors mode="RemoteOnly" defaultRedirect="errors/ErrorPage.aspx"> <error statusCode="400" redirect="errors/ErrorPage400.aspx"...
2
19403
hyperpau
by: hyperpau | last post by:
Before anything else, I am not a very technical expert when it comes to VBA coding. I learned most of what I know by the excellent Access/VBA forum from bytes.com (formerly thescripts.com). Ergo, I...
10
6931
by: happyse27 | last post by:
Hi All, I got this apache errors(see section A1 and A2 below) when I used a html(see section b below) to activate acctman.pl(see section c below). Section D below is part of the configuration...
15
3227
by: Lawrence Krubner | last post by:
Does anything about this script look expensive, in terms of resources or execution time? This script dies after processing about 20 or 25 numbers, yet it leaves no errors in the error logs. This is...
0
2897
hyperpau
by: hyperpau | last post by:
Before anything else, I am not a very technical expert when it comes to VBA coding. I learned most of what I know by the excellent Access/VBA forum from bytes.com (formerly thescripts.com). Ergo, I...
0
7371
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7023
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7479
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5617
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5037
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4702
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3178
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1534
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
757
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.