IIS error: The page cannot be found

# Filed on Dec 27, 2006 by Anthony DiSante 6 replies

When accessing a file on a Microsoft IIS6 server, you may receive the following error:

The page cannot be found

[...]

HTTP Error 404 - File or directory not found.
Internet Information Services (IIS)

You may receive that error even for files that you know darn well do exist at the exact location you specified.

But Microsoft, no fan of simplicity, hijacks the specific and well-defined 404 status code to cover any number of possible problems with the request, which have nothing whatsoever to do with whether the page could be found.

If you check your logfiles in %WINDIR\System32\Logfiles (probably in a subfolder like W3SVC1), you may see some lines that end like this:

 ... 404 3 50

So that’s a "404.3" error, which apparently means that "[a file] extension is not mapped to a known extention [sic] in the MIME Map property."

Notice that the error displayed in the browser is not only entirely useless, it’s actually false.  Beyond that, it’s ridiculous that IIS fails to default to a sensible behavior like downloading the file anyway as a generic binary type, choosing instead to turn it into an error condition.

Just another way that Microsoft makes developers’ lives so much harder than they need to be...

Comments:

01. Oct 31, 2008 at 02:20pm by ecards:

Very helpful, thank you.

I am pulling my hair out trying to figure out why a simple .inc file that I know is there is not loaded.

On my way to the logs...

02. Feb 3, 2009 at 11:12am by Adam:

Sorry to say but your microsoft bashing is quite unfounded.  I’m no special fan of Microsoft and I agree that sometimes I wonder if any of their developers actually ever try and develop against their products, but this is not that stupid.  Read this and I think you’ll find the justification is quite sensible.


Substatus error codes

03. Feb 3, 2009 at 01:52pm by AnthonyDiSante:

I’m not bashing Microsoft, I’m pointing out a policy that is extremely stupid.  You’re wrong if you think it’s sensible to report "file not found" in a situation where the file DOES EXIST.  The reported error does not match the actual situation, it’s as simple as that.

04. Aug 10, 2009 at 04:37pm by Mike:

You go, AnthonyDiSante!

Adam’s rebuttal from MS amounts to giving an incorrect error message in order to hide the sub-status details from evil doers.  By that logic, why not give a 404 error for everything that goes wrong on a .NET site?  Why have error codes at all?

I’d suggest MS use a 500 Application Error with no sub-status details.  Details are still hidden (but available to developers in the logs) and the developer is not sent down the wrong path.  The false 404 File Not Found Error is just maddening!

05. Dec 16, 2009 at 06:12am by tata:

i faced this error. i resolved it with putting the MIME type for the extension in HTTP Headers of Website properties...

06. Dec 21, 2009 at 06:15am by michael:

helped me, thanks!

Reply to this message here:

Your name
Email (why?)
Website (if you have one)
Subject
search posts:

home | archives ]