How can I change error path to my controller/action with httpErrors?
I have this code:
<httpErrors errorMode="Custom">
<remove statusCode="404"/>
<error responseMode="ExecuteURL" statusCode="404" path="Error/HttpRequestError"/>
</httpErrors>
But it doesn't work. Empty page shows and action not entered.
What i do wrong?
P.S. I know about another way to sovle custom page errors. But i want try to use it.
Thanks!
I resolve a problem. This code of web.config works:
Now entered in ErrorsController/NotFound action(marked with routing atribute ActionName to 404).
If Sergey Shoshin's answer does not work.
Why dont you simply redirect the url for 404