By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
428,558 Members | 1,533 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 428,558 IT Pros & Developers. It's quick & easy.

Customerrors in web.config question

P: n/a
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
Share this Question
Share on Google+
10 Replies


P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a


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

P: n/a
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

P: n/a


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 discussion thread is closed

Replies have been disabled for this discussion.