In my web config I have this setting:
<httpErrors errorMode="Custom" defaultPath="/Error/Error/ErrorHandler/404" defaultResponseMode="ExecuteURL" />
I would like to redirect all IIS errors to go to my own controller and action. However I get the error:
The requested page cannot be accessed because the related configuration data for the page is invalid.
However, If I try to redirect specific error codes to my controller, it will work. E.g:
<httpErrors errorMode="Custom" >
<remove statusCode="403"/>
<error statusCode="403" responseMode="ExecuteURL" path="/Error/Error/ErrorHandler/404"/>
</httpErrors>
How can I change my default redirect to go to my controller/action?