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 ]

Client Quotes

I just installed the demo of your product and got it up and running in no time.  I searched high and low for a decent login script and thank God I found yours.
– Adrian F.
I spent ages trying to find a way of making my own log in page for my website - if you're thinking of doing that forget it - don't waste your time!  UserBase is a 1st class product at a very reasonable price.  The software works faultlessly and can be adapted to any situation.  The service that I have received from Encodable is terrific!  I am very very impressed.  Nothing was too much trouble and I am most grateful to Anthony DiSante in particular for all his help and patience.
– Paul S.
Worked like a charm... man, this piece of software is a dream and I really appreciate all your customer service help getting this taken care of.
– Kyle M.
I just want to say you guys really stand alone in that you have a quality product and you provide genuine customer service.  It's sad but those qualities are seldom found separately, much less together.  Thanks again for your time and help.
– Alex S.
Also, I wanted to tell you that I was very skeptical about buying this script.  I've spent a lot of time and money over the past 3 months trying to find a solution that works, but I ended up having problems with so many of the scripts I tried that I was almost to the point of giving up.  But then I came across your script, and it actually does what it's supposed to.  An absolute wow.  A very impressive and powerful script indeed!  Many, many thanks!
– Mike E.
I can't thank you enough, I was up against a deadline that required me to get this up and running in 48 hours and you have probably the best customer service I've ever seen.
– Dan T.
Your scripts/software are the greatest, I mean I really love how customizable they are, how intuitive they are, and so on.  Thanks again, I love this stuff!
– Tucker O.
We searched for a long time for an application to password protect directories and allow file uploads.  Userbase & Filechucker are far superior to anything out there.  Simple yet powerful programming, extremely flexible in configuration, and great customer service.  Thanks for a superb product.
– Kat G.
Thank you VERY much for all of your help.  You've really impressed me.  We have support agreements for other software that costs thousands of dollars / year (just for the support), and most of them aren't as helpful as you have been.
– Keith Y.
There are a lot of these scripts out there, but I think they all pale in comparison to yours.
– Peter W.
The software has some great features, is well presented, runs where others are problematic and will make a good impression on our clients.  We look forward to reaping its benefits!
– Alex H.