473,513 Members | 2,358 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Customerrors in web.config question

I am working on a website that someone else has set up. They have a
web.config file with a customerrors element that points the error handling
to a special aspx page.

<customErrors mode="RemoteOnly" defaultRedirect="/customerrors/500.aspx">
<error statusCode="404" redirect="/customerrors/404.html" />
</customErrors>

When running pages directly on the server it still redirects when a error
occurs, even though it should not judging by the "RemoteOnly" setting. I
have also tried just setting the mode to "Off" but that does not change the
behavior either. What could I be missing? I have looked for other config
file but have found none. Anybody got any ideas why I cannot turn off the
error handling, or where I can look to figure out what is going on?

Nov 19 '05 #1
10 2833
Are you sure the website is setup as an Application
( or at least as a virtual directory ) in IIS ?

customErrors mode will only work if the web.config
file is placed in the root directory of an IIS application
or in an IIS virtual directory.

The customError settings only apply to ASP.NET files
(files with specific ASP.NET extensions such as aspx and asmx).

If a user requests an .htm or .asp file that does not exist on
your Web server, even if you have the "404" redirect specified
in web.config, IIS will redirect the user based on the HTTP
error settings defined within the IIS metabase and not by the
error settings in the Web.config file.

..asp and .htm files are not managed by ASP.NET.

The ASP.NET Web.config file settings apply to the
application's directory and any child directories.

These settings can be overridden for specific pages using
the ErrorPage attribute of the Page directive.

Juan T. Llibre
ASP.NET MVP
===========
"Ron Weldy" <ro******@msn.com> wrote in message
news:O$****************@TK2MSFTNGP14.phx.gbl...
I am working on a website that someone else has set up. They have a
web.config file with a customerrors element that points the error handling
to a special aspx page.

<customErrors mode="RemoteOnly" defaultRedirect="/customerrors/500.aspx">
<error statusCode="404" redirect="/customerrors/404.html" />
</customErrors>

When running pages directly on the server it still redirects when a error
occurs, even though it should not judging by the "RemoteOnly" setting. I
have also tried just setting the mode to "Off" but that does not change
the behavior either. What could I be missing? I have looked for other
config file but have found none. Anybody got any ideas why I cannot turn
off the error handling, or where I can look to figure out what is going
on?

Nov 19 '05 #2
Thanks. I am assuming that the web.config files are not controlling what is
happening but I didn't know where to look. I'll check into your suggestions.
It's script errors that get redirected that I would like to be able to
switch when debugging and then restore after completion. I think this has
been set up as an application and that the config file is in the root, but I
will make sure.

Also, if anyone has a good recommendation on where to read up on the way
this works that would be helpful. I seem to have trouble finding a concise
description on the different levels of error handling in IIS 6 and ASP.NET
and how they interrelate.
"Juan T. Llibre" <no***********@nowhere.com> wrote in message
news:u3**************@tk2msftngp13.phx.gbl...
Are you sure the website is setup as an Application
( or at least as a virtual directory ) in IIS ?

customErrors mode will only work if the web.config
file is placed in the root directory of an IIS application
or in an IIS virtual directory.

The customError settings only apply to ASP.NET files
(files with specific ASP.NET extensions such as aspx and asmx).

If a user requests an .htm or .asp file that does not exist on
your Web server, even if you have the "404" redirect specified
in web.config, IIS will redirect the user based on the HTTP
error settings defined within the IIS metabase and not by the
error settings in the Web.config file.

.asp and .htm files are not managed by ASP.NET.

The ASP.NET Web.config file settings apply to the
application's directory and any child directories.

These settings can be overridden for specific pages using
the ErrorPage attribute of the Page directive.

Juan T. Llibre
ASP.NET MVP
===========
"Ron Weldy" <ro******@msn.com> wrote in message
news:O$****************@TK2MSFTNGP14.phx.gbl...
I am working on a website that someone else has set up. They have a
web.config file with a customerrors element that points the error handling
to a special aspx page.

<customErrors mode="RemoteOnly" defaultRedirect="/customerrors/500.aspx">
<error statusCode="404" redirect="/customerrors/404.html" />
</customErrors>

When running pages directly on the server it still redirects when a error
occurs, even though it should not judging by the "RemoteOnly" setting. I
have also tried just setting the mode to "Off" but that does not change
the behavior either. What could I be missing? I have looked for other
config file but have found none. Anybody got any ideas why I cannot turn
off the error handling, or where I can look to figure out what is going
on?


Nov 19 '05 #3
Ron, if you're trying to disable the custom error handling, then;

+ get rid of the defaultRedirect="" attribute
+ delete the <error /> entity

That should make the custom errors go away.
"Ron Weldy" <ro******@msn.com> wrote in message
news:O$**************@TK2MSFTNGP14.phx.gbl...
I am working on a website that someone else has set up. They have a
web.config file with a customerrors element that points the error handling
to a special aspx page.

<customErrors mode="RemoteOnly" defaultRedirect="/customerrors/500.aspx">
<error statusCode="404" redirect="/customerrors/404.html" />
</customErrors>

When running pages directly on the server it still redirects when a error
occurs, even though it should not judging by the "RemoteOnly" setting. I
have also tried just setting the mode to "Off" but that does not change the behavior either. What could I be missing? I have looked for other config
file but have found none. Anybody got any ideas why I cannot turn off the
error handling, or where I can look to figure out what is going on?

Nov 19 '05 #4
I tried changing it to <customErrors mode="RemoteOnly"/> and <customErrors
mode="Off"/> but it had no effect at all. I even stopped and restarted the
site.

- Ron
"MWells" <outbound__at_sygnal.com> wrote in message
news:OS**************@TK2MSFTNGP11.phx.gbl...
Ron, if you're trying to disable the custom error handling, then;

+ get rid of the defaultRedirect="" attribute
+ delete the <error /> entity

That should make the custom errors go away.
"Ron Weldy" <ro******@msn.com> wrote in message
news:O$**************@TK2MSFTNGP14.phx.gbl...
I am working on a website that someone else has set up. They have a
web.config file with a customerrors element that points the error
handling
to a special aspx page.

<customErrors mode="RemoteOnly"
defaultRedirect="/customerrors/500.aspx">
<error statusCode="404" redirect="/customerrors/404.html" />
</customErrors>

When running pages directly on the server it still redirects when a error
occurs, even though it should not judging by the "RemoteOnly" setting. I
have also tried just setting the mode to "Off" but that does not change

the
behavior either. What could I be missing? I have looked for other config
file but have found none. Anybody got any ideas why I cannot turn off the
error handling, or where I can look to figure out what is going on?


Nov 19 '05 #5
It works depending on the way how you access your site.

Even when you are running locally you need to access it by 127.0.0.1 and not by www.mysite.com (or ip address)

The site would not know how you are accessing it (localy or not) if you are using inet name or ip address
George.

"Ron Weldy" <ro******@msn.com> wrote in message news:O$****************@TK2MSFTNGP14.phx.gbl...
I am working on a website that someone else has set up. They have a
web.config file with a customerrors element that points the error handling
to a special aspx page.

<customErrors mode="RemoteOnly" defaultRedirect="/customerrors/500.aspx">
<error statusCode="404" redirect="/customerrors/404.html" />
</customErrors>

When running pages directly on the server it still redirects when a error
occurs, even though it should not judging by the "RemoteOnly" setting. I
have also tried just setting the mode to "Off" but that does not change the
behavior either. What could I be missing? I have looked for other config
file but have found none. Anybody got any ideas why I cannot turn off the
error handling, or where I can look to figure out what is going on?

Nov 19 '05 #6
re:
I even stopped and restarted the site.
That was unneeded. Modifying web.config will restart it for you

re:it had no effect at all
If you set it to:

<customErrors mode="Off"
</customErrors>

It still shows error pages ?

Also, check global.asax to see if there's
an Error handling configuration there.

( In the Application_Error code block )


Juan T. Llibre
ASP.NET MVP
===========
"Ron Weldy" <ro******@msn.com> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...I tried changing it to <customErrors mode="RemoteOnly"/> and <customErrors
mode="Off"/> but it had no effect at all. I even stopped and restarted the
site.

- Ron
"MWells" <outbound__at_sygnal.com> wrote in message
news:OS**************@TK2MSFTNGP11.phx.gbl...
Ron, if you're trying to disable the custom error handling, then;

+ get rid of the defaultRedirect="" attribute
+ delete the <error /> entity

That should make the custom errors go away.
"Ron Weldy" <ro******@msn.com> wrote in message
news:O$**************@TK2MSFTNGP14.phx.gbl...
I am working on a website that someone else has set up. They have a
web.config file with a customerrors element that points the error
handling
to a special aspx page.

<customErrors mode="RemoteOnly"
defaultRedirect="/customerrors/500.aspx">
<error statusCode="404" redirect="/customerrors/404.html" />
</customErrors>

When running pages directly on the server it still redirects when a
error
occurs, even though it should not judging by the "RemoteOnly" setting. I
have also tried just setting the mode to "Off" but that does not change

the
behavior either. What could I be missing? I have looked for other config
file but have found none. Anybody got any ideas why I cannot turn off
the
error handling, or where I can look to figure out what is going on?

Nov 19 '05 #7
Really? That has not been my experience. There are several sites on this server and for some it works fine accessing the site from the server using the domain. When I access from the server I get a complete error message and from outside I get the redirect.

It just seems that on this one site that I have problems. At any rate, I plan to look into the points that Juan made so hopefully I can track down the problem. It is odd...

It probably does not help that there is a mixture of asp, aspx, html and other stuff on here.

- Ron

"George" <no****@hotmail.com> wrote in message news:OF**************@TK2MSFTNGP14.phx.gbl...
It works depending on the way how you access your site.

Even when you are running locally you need to access it by 127.0.0.1 and not by www.mysite.com (or ip address)

The site would not know how you are accessing it (localy or not) if you are using inet name or ip address
George.

"Ron Weldy" <ro******@msn.com> wrote in message news:O$****************@TK2MSFTNGP14.phx.gbl...
I am working on a website that someone else has set up. They have a
web.config file with a customerrors element that points the error handling
to a special aspx page.

<customErrors mode="RemoteOnly" defaultRedirect="/customerrors/500.aspx">
<error statusCode="404" redirect="/customerrors/404.html" />
</customErrors>

When running pages directly on the server it still redirects when a error
occurs, even though it should not judging by the "RemoteOnly" setting. I
have also tried just setting the mode to "Off" but that does not change the
behavior either. What could I be missing? I have looked for other config
file but have found none. Anybody got any ideas why I cannot turn off the
error handling, or where I can look to figure out what is going on?

Nov 19 '05 #8


I encountered the same error: after deploying a Web Application on the
production server, I get this generic error page. My problem is how can
I see what is the error exactly, as I have more than one website on that
server ( using host headers). If I copy the application in a virtual
directory under another website on the same server, it works. When I
install or copy it in the root or a virtual directory under the Website
where I want it to be, it doesn't work. Any help will be appreciated.
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 19 '05 #9
Razvan,

It depends what settings you put under the <customerrors mode = ""> tag to
see a specific ASP .NET specific error page instead of an user-defined error
page. Can you elaborate more on this ?

regards
Joyjit

"Razvan Petcu" <ra******@yahoo.com> wrote in message
news:ez**************@TK2MSFTNGP09.phx.gbl...


I encountered the same error: after deploying a Web Application on the
production server, I get this generic error page. My problem is how can
I see what is the error exactly, as I have more than one website on that
server ( using host headers). If I copy the application in a virtual
directory under another website on the same server, it works. When I
install or copy it in the root or a virtual directory under the Website
where I want it to be, it doesn't work. Any help will be appreciated.
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Nov 19 '05 #10


I figured it out... the NETWORK SERVICE user account did not have any
right on the root folder of the website I was trying to install the web
application in. The checkbox "Allow inheritable permissions from the
parent to propagate to this object..." on the "Advanced Security
Settings for <folder name>"was unchecked. Sorry about this.. I should
have figured it out right away.
However, the question remains: I wasn't able to see the error message
even after setting the mode attribute of customErrors tag in web.config
to "Off". Why is that? And more... suppose I leave this to
"RemoteOnly"... and connect remotely to the server and open an IE window
for "http://localhost/myapp_name/"... it doesn't work..as I have more
than one website on this server (using host headers)... Anyway...
another question would be: how can I access my application locally on
the production server, when it is installed under the root of a website
that uses host headers (note: all the websites use the same IP address)

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 19 '05 #11

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

Similar topics

5
1191
by: Pete Davis | last post by:
I posted a question about this earlier, but I thought I'd take a different tack. Has anyone compiled a list of all the things that can cause setting the customErrors mode to "Off" in the web.config...
6
1466
by: Samuel | last post by:
A few (not all) of my clients are getting this error with a web thumbnail generator code I wrote ============================= Runtime Error Description: An application error occurred on the...
6
6101
by: John Smith | last post by:
I am trying to implement custom error pages and I get this error message: **************************************************************************** ********...
21
4940
by: nicholas | last post by:
Although in my web.config I have <customErrors mode="off" /> I still get no detailed errors. How comes ? THX This is what I get: Server Error in '/mywebfolder'Application.
1
6518
by: Chumley Walrus | last post by:
I'm having trouble seeing my page when I publish it on my live server. I created a project in VS.net (with MMIT integrated), created a simple index.aspx mobilewebform page , I can see it in my...
5
39001
by: Savas Ates | last post by:
I have a web application It works well in my local folder.. When i upload it to my web server i got To enable the details of this specific error message to be viewable on remote machines,...
2
3484
by: Max Metral | last post by:
I'm trying to set the default behavior of customErrors in the machine.config. The documentation seems to suggest this should work, but it doesn't seem to work for me. On my development machine, I...
9
4256
by: =?Utf-8?B?TWlrZQ==?= | last post by:
Hi. Is it programatically possible in VB.NET to read the contents of web.config's <customErrorselement? I looked at using ConfigurationSettings.AppSettings, but that doesn't work. I need to...
0
7267
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7175
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7391
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7553
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
7120
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
4754
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
3247
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
1
809
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
466
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.