views:

33

answers:

1

Here is what I have in my web.config:

<customErrors mode="On" defaultRedirect="/pages/sitemap">
      <error statusCode="404" redirect="/pages/sitemap" />
    </customErrors>

Locally this works just as expected but live for some reason I still get the vanilla 404 error page?

I am using MVC 2 with Areas, throughts?

A: 

Just a quick thought, have you tried adding the ~ to your redirects? Your application/directory structure is probably different on PROD than on your local test machine.

<customErrors mode="On" defaultRedirect="~/pages/sitemap"> 
      <error statusCode="404" redirect="~/pages/sitemap" /> 
    </customErrors> 

Also, take a look if you have the something similar to the following snippet in your web.config

<httpErrors errorMode="DetailedLocalOnly">
<error statusCode="403" subStatusCode="4" path="custerr\403.4.htm" responseMode="File" />
</httpErrors>

This 'could' be overriding your settings.

Tommy
yes, tried that with zero luck -thanks though
Slee
I've seen other comments on SO about IIS settings in the web.config overriding your customErrors. Let me see if I can find anything else out on that...
Tommy