I have set up a general error page where I want the user directed whenever something somewhere throws a wobbly. However I can't seem to get the user directed to the error page when they try to access a restricted path - such as App_Data. Instead they see an unfriendly: HTTP Error 404.8 - Not Found bla bla bla..
My webconfig:
<customErrors mode="On" defaultRedirect="~/Home/RenderError">
</customErrors>
I have also tried this:
<customErrors mode="On" defaultRedirect="~/Home/RenderError">
<error statusCode="404" redirect="~/Home/RenderError" />
</customErrors>
Any idea? Thank you!