Troubleshooting a 404
Since IIS 6, Microsoft has made it very easy to troubleshoot the cause of a 404 "not found" error from the web server. Most admins don't realize that the IIS log file can now include the substatus code along with the 404.
The first step is to make sure that you are using the W3C log file format and that you have selected Protocol Substatus code as one of the extended logging fields as in the example below.
You can now lookup 404 entry in the log file to determine why the resouce is coming back as "not found". In this example, we see a request for a Flash file that is failing:
#Fields: date time c-ip cs-username s-computername s-ip cs-method cs-uri-stem cs-uri-query sc-status sc-substatus sc-win32-status sc-bytes cs-bytes time-taken cs-version cs-host cs(User-Agent) cs(Cookie) cs(Referer)
2009-04-10 00:21:55 133.71.125.97 - WEBSERVER 133.73.246.56 GET /media/logic.swf - 404 3 0 93241 920 2141 HTTP/1.1 www.server.com Mozilla/4.0+(compatible;+MSIE+6.0;+Windows+NT+5.1+.NET+CLR+2.0.50727;+MS-RTC+LM+8) - -
You can see that the status and substatus logged are 404 3. The following MSKB articles are helpful for looking up the status codes with their corresponding causes and remedies:
IIS 6: http://support.microsoft.com/kb/318380
IIS 7: http://support.microsoft.com/kb/943891
The MSKB tells us that 404.3 means that the mime map policy prevents this request. In other words, the .swf file is an unknown mime-type to IIS. We simply need to define the mime-type for .swf and IIS will now serve the file.
The following articles are also helpful in torubleshooting 404 errors: