Browser prompts to download the default HTM / HTML files when browsing the site

Problem

You will be prompted to download the HTM or HTML file (default document) if you browse https://servername or https://servername/vdir without specifying the file name in the URL. This occurs only if your default document is HTM and HTML files, not for ASP / ASPX

Symptoms

Fiddler trace shows that the request content type is an unknown MIME type and you will be prompted to download a document with no extension which is the default document of the website or the virtual directory.

Cause

Unknown MIME Type forcing the browser to download the document

Resolution

Remove the wildcard MIME mapping or mapping for .HTM / .HTML associated with an unknown MIME type (e.g. Application/myMIME) in the Server level / Master level / File level MIME mappings.

To check the MIME mapping, go to the properties, click on HTTP Headers -> MIME Types.

In one of my case I worked today, the customer had a wildcard mapping as “application/octet-stream.” (Note the . in the MIME type).