In my asp.net web site I have custom error pages defined as following in my web.config file.
If you add the following to your 404 page code behind. You will get the correct results -
Page 404.aspx
protected void Page_Load(object sender, EventArgs e) { Response.StatusCode = 404; }