The system.web part of my web.config file has the following :
<customErrors defaultRedirect="~/Errors/GeneralError.html" mode="On">
<error statusCode="404" redirect="~/Errors/Error404.aspx" />
<error statusCode="403" redirect="~/Errors/Error403.aspx" />
The error 403 page is correctly called when I try to access, for example the web.config file with the browser. However, I cannot get the dyamic 404 page to be called - the IIS default is called instead.
Can anyone explain what on earth is going wrong? It looks so simple in principle!
In my application, the 404 custom error must be configured from the web.config file. A direct change to the IIS would otherwise do the job, but this is not an option.