IIS7 responds with a 404 when extension is not listed in the Mime Types. Can't IIS simply serve the file as a default type?

8,326

Solution 1

Older versions of IIS had this built-in, but IIS 6.0+ does not.
If you want it to serve just any file regardless of having a registered MIME type:

  1. Open IIS Manager
  2. Click the Server, then open MIME Types in the Features View Pane.
  3. Add from the Actions Pane
  4. File name extension: *
  5. MIME Type: application/octet-stream (if you want the browser to download the file) or plain/text (if you want the file displayed)
  6. OK

Solution 2

You can use "." (a dot) as extension and create a MIME mapping. https://forums.iis.net/t/1158170.aspx

Share:
8,326

Related videos on Youtube

PaulS
Author by

PaulS

Updated on September 18, 2022

Comments

  • PaulS
    PaulS over 1 year

    How do I configure IIS to return files whether or not they are listed in the Mime Types list? It doesn't make sense for IIS to return a 404 when the file exists.

    • PaulS
      PaulS about 11 years
      All I could do was add each non-common file extension to Mime Types. That worked but you know it's not a good solution.