I have a strange problem and I'm looking for some debug pointers. When a page has been removed from a site I do the following:
Response.StatusCode = 410;
Response.Status = "410 Gone";
return View("PageRemoved");
In the dev environment it works fine. In prod, the browser simply prints: "The page you requested was removed." but the View is not rendered. The 410 status is returned in both environments. At one point this was working in prod but I don't know when.
Is it possible that IIS is intercepting the 410 return code and printing this message? If so, where in IIS would this have been setup? How would you debug this? (I've put log statements in the code and the code path is identical in both environments.)