使用IIS以纯文本形式提供不带扩展名的文件 [英] using IIS to serve files without extension as plain text

查看:112
本文介绍了使用IIS以纯文本形式提供不带扩展名的文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试使用> IIS:如何提供服务没有扩展名的文件吗?

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

让我定位文件,但不能访问

Which is letting me target the file, but not access it

HTTP错误404.3-未找到

由于扩展名的原因,无法提供您所请求的页面 配置.如果页面是脚本,请添加处理程序.如果文件 应该被下载,添加一个MIME映射.

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>

这篇关于使用IIS以纯文本形式提供不带扩展名的文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆