Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

customErrors in web.config

Status
Not open for further replies.

markknowsley

Programmer
Aug 30, 2005
152
GB
I'm trying to get the customErrors tag in my web.config file to run a custom error page rather than the generic

Runtime Error
Description: An application error occurred on the server...

that users see when something goes wrong.

So I've followed the advice printed on about 100 different websites - set the tag as follows:

<customErrors mode="RemoteOnly" defaultRedirect="Error.htm" >
<error statusCode="403" redirect="Error.htm" />
<error statusCode="404" redirect="Error.htm" />
</customErrors>

But when I copy the app across to the web server and run it, it still shows the generic error screen rather than Error.htm.

Has anyone experience this before and does anyone know what is going on?
 
Hi,

I noticed you have the RemoteOnly tag set in the web.config therefore if you are working locally you will always see the detailed error screen - try substituting RemoteOnly for On.

I hope this helps.

Mick
 
Tried setting it to "On" and still getting the same result - i.e. the generic error page is still appearing.

I've tried changing the redirect to in case it doesn't like my file location but this didn't make any difference.
 
I've just tried

<customErrors defaultRedirect="Error.htm" mode="On" />

and it works for me - are you using "Smart Navigation" on any of your pages? If you are there is bug that stops defaultRedirect working.

Hope this helps.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top