i want in my app to have custom error pages for 401, 404 etc error codes.
I try this but doesn't work? In Web.config
<customErrors mode="Off" /> //Under system.web
<httpErrors errorMode="Custom" existingResponse="Replace" >//Under system.webServer
<clear />
<remove statusCode="401"/>
<error statusCode="401" responseMode="ExecuteURL" path="/Error/Unauthorized" />
<error statusCode="404" responseMode="ExecuteURL" path="/Error/NotFound" />
<error statusCode="500" responseMode="ExecuteURL" path="/Error" />
</httpErrors>
I have create also Error controller and Unauthorized views.
How can this work?