我需要转换 .htaccess
AddType application/x-httpd-php .txt
到 web.config。你能帮我吗?我试过
<configuration>
<system.web>
<httpHandlers>
<add verb="*" path="*.txt"
type="php " />
</httpHandlers>
</system.web>
</configuration>
但这对我不起作用。所以我需要在IIS上打开像php这样的txt文件。
最佳答案
这对我有用:
<configuration>
<system.webServer>
<staticContent>
<mimeMap fileExtension=".syx" mimeType="application/octet-stream" />
<mimeMap fileExtension=".tab" mimeType="text/plain" />
</staticContent>
</system.webServer>
</configuration>
来源:http://www.iis.net/configreference/system.webserver/staticcontent/mimemap
关于.htaccess - 将 AddType 规则从 htaccess 转换为 web.config,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10817035/