According to your description, I think you should make sure the redirect path is correct. Second you should make sure the connection string is correct. Also we should make sure the StatusCode is existed in the custom error code.
There are some articals, please refer to the link below:
None
0 Points
26 Posts
Question about CustomErrors
Jun 06, 2014 09:55 AM|fabjoe|LINK
Dear all I'm facing a strange behavior with customerror configuration
In my website I've configured in web.config the following parameters:
<customErrors mode="On" defaultRedirect="/htm/errore_o.htm">
<error statusCode="404" redirect="/errore404.htm" />
<error statusCode="500" redirect="/errore404.htm"/>
</customErrors>
<httpErrors>
<remove statusCode="500" subStatusCode="-1" />
<remove statusCode="404" subStatusCode="-1" />
<error statusCode="404" prefixLanguageFilePath="" path="/errore404.htm" responseMode="ExecuteURL" />
<error statusCode="500" prefixLanguageFilePath="" path="/m/GesErr/error.asp" responseMode="ExecuteURL" />
</httpErrors>
When I call the following url
http://www.mysite.com/myfolder/search.aspx?aspxerrorpath=%3CCa
The custom error page is not displayed but appears the YSOD
When I call the following url
http://www.mysite.com/myfolder/search.aspx?%3CCa
the custom error page is correctly displayed.
To complete the strange situation, this behavior appears only in Production site, not in development environment
Can someone help me to identify the problem?
Best regards
Fabrizio
All-Star
18232 Points
2199 Posts
Re: Question about CustomErrors
Jun 09, 2014 05:02 AM|Michelle Ge - MSFT|LINK
Hi,
According to your description, I think you should make sure the redirect path is correct. Second you should make sure the connection string is correct. Also we should make sure the StatusCode is existed in the custom error code.
There are some articals, please refer to the link below:
http://www.c-sharpcorner.com/Blogs/1449/customerror-mode-in-web-config-file.aspx
http://www.serverintellect.com/support/aspnet/disable-aspnet-custom-errors-webconfig/
http://msdn.microsoft.com/en-us/library/h0hfz6fc(v=vs.85).aspx
Hope it's useful for you.
Best Regards,
Michelle Ge
All-Star
52711 Points
9668 Posts
MVP
Re: Question about CustomErrors
Jun 11, 2014 07:31 PM|Ruchira|LINK
Set the TrySkipIisCustomErrors to True.
http://briancaos.wordpress.com/2012/06/12/custom-404-page-ignored-by-iis-7/
http://blog.janjonas.net/2011-04-13/asp_net-prevent-iis_75_overriding-custom-error-page-iis-default-error-page
Please 'Mark as Answer' if this post helps you
Developer Tools Download | Windows 10 Videos | My Tech Blog