0

I'm trying to perform a verification process by posting a file onto my domain. Then, from the company admin portal, I should be able to browse to that file and complete the verification process. It fails because my site returns a 404 Error stating the resource doesn't exist, when it actually does. How do I get my web.config to recognize a request for a file with no file extension?!

In my web.config, but this doesn't work:

`<configuration>
     <system.webServer>
        <staticContent>
           <mimeMap fileExtension="*" mimeType="text/plain" />
        </staticContent>
                              .
                              . 
                              .`

@LexLi, answered this question! Here's how I updated my web.config file (below).

`<configuration>
     <system.webServer>
        <staticContent>
           <mimeMap fileExtension="." mimeType="text/plain" />
        </staticContent>
                              .
                              . 
                              .`
LargeDachshund
  • 916
  • 3
  • 12
  • 25
  • 1
    I wrote about it a decade ago, https://blogs.msdn.microsoft.com/lexli/2009/06/05/iis-7-dot-tricks-part-i/ – Lex Li Sep 15 '18 at 01:04
  • @LexLi, I want to give you credit for the answer! Post your Answer! Worked perfectly!! – LargeDachshund Sep 16 '18 at 03:24
  • Possible duplicate of [IIS: How to serve a file without extension?](https://stackoverflow.com/questions/19950882/iis-how-to-serve-a-file-without-extension) – Lex Li Sep 16 '18 at 03:39

1 Answers1

0

Copied from the comment.

For files with no extension, you have to use . in the mimeMap tag as fileExtension.

When I wrote the blog post in 2009, I was working for Microsoft and my colleague reviewed the source code of IIS to confirm that. Sadly it was never made part of the official documentation, so even after 2009 there were tons of discussions on how to.

Lex Li
  • 60,503
  • 9
  • 116
  • 147