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:
- Open IIS Manager
- Click the Server, then open MIME Types in the Features View Pane.
- Add from the Actions Pane
- File name extension:
*
- MIME Type:
application/octet-stream
(if you want the browser to download the file) orplain/text
(if you want the file displayed) - OK
Solution 2
You can use "." (a dot) as extension and create a MIME mapping. https://forums.iis.net/t/1158170.aspx
Related videos on Youtube
Author by
PaulS
Updated on September 18, 2022Comments
-
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 about 11 yearsAll I could do was add each non-common file extension to Mime Types. That worked but you know it's not a good solution.
-