Return HTTP status code 404 and error content in ASP.NET MVC
The key thing is to return the Real 404 HTTP status code and avoid any solution that replaces 404 with 301. This is completely wrong and has the potential to do damage to your site.
Continue reading