使用 IIS 将没有扩展名的文件作为纯文本提供

using IIS to serve files without extension as plain text

我试过使用来自 IIS: How to serve a file without extension?

的答案
 <?xml version="1.0" encoding="UTF-8"?>
 <configuration>
     <system.webServer>
         <staticContent>
             <mimeMap fileExtension=".*" mimeType="text/plain" />
         </staticContent>
     </system.webServer>
 </configuration>

允许我定位文件,但不能访问它

HTTP Error 404.3 - Not Found

The page you are requesting cannot be served because of the extension configuration. If the page is a script, add a handler. If the file should be downloaded, add a MIME map.

试试这个

<staticContent>
   <mimeMap fileExtension="." mimeType="text/html" />
</staticContent>