IIS Can’t Serve Certain File Extension

http-status-code-404iiswindows-server-2003

I'm serving .JSON files, but even though the file exist, IIS keeps throwing 404 error when any of the file is accessed. I tried renaming one of the file to .JS, and it works.

Any pointer what setting can cause this issue?

Best Answer

By default, IIS in W2K3 and above won't serve files that aren't of a MIME type that it knows about (instead returning 404 errors).

You need to add a MIME type to IIS to allow it to serve that type of file. You can set it at the site level or at the server level.

To set this for the entire server:

  • Open the properties for the server in IIS Manager and click MIME Types
  • Click "New". Enter "JSON" for the extension and "application/json" for the MIME type.