I want my ASP.NET MVC application to redirect failed requests to match the action methods of a specific controller. This works fine on my development machine running Windows 7, but not on my operating machine running Windows 2008 R2.
I installed my web.config as follows:
<customErrors mode="On" defaultRedirect="/Error/ServerError/500">
<error statusCode="403" redirect="/Error/AccessDenied" />
<error statusCode="404" redirect="/Error/FileNotFound" />
</customErrors>
This customErrors section works fine on both of my machines (production and development) for 500 internal server errors.
It also works great for 404 errors on my development machine.
However, it incorrectly redirects 404 errors to the production computer. Instead of / Error / FileNotFound, I get a standard 404 page that comes with IIS 7.
What could be the problem?