IIS删除.html扩展名对文件夹文件不起作用浏览

IIS删除.html扩展名对文件夹文件不起作用浏览,iis,Iis,在iis中浏览时,当我浏览本地主机时,如果该主机应该显示未显示的索引或默认html,并且当我浏览文件夹中任何扩展名为o的文件时,如果显示HTTP错误404.0-未找到,则尝试删除.html扩展名 您正在查找的资源已被删除、名称已更改或暂时不可用。认为该文件存在 我的web.config <?xml version="1.0" encoding="UTF-8"?> <configuration> <system.webServer> <defaultDoc

在iis中浏览时,当我浏览本地主机时,如果该主机应该显示未显示的索引或默认html,并且当我浏览文件夹中任何扩展名为o的文件时,如果显示
HTTP错误404.0-未找到,则尝试删除.html扩展名
您正在查找的资源已被删除、名称已更改或暂时不可用。
认为该文件存在

我的web.config

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<defaultDocument>
<files>
<clear />
<add value="index.html" />
<add value="Default.htm" />
<add value="Default.asp" />
<add value="index.htm" />
<add value="iisstart.htm" />
<add value="default.aspx" />
</files>
</defaultDocument>
<rewrite>
<rules>
<rule name="Hide .html ext">
<match url="^(.*)" ignoreCase="true" />
<conditions>
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
<add input="{REQUEST_FILENAME}.html" matchType="IsFile" />
</conditions>
<action type="Rewrite" url="{R:0}.html" />
</rule>
<rule name="Redirecting .html ext" stopProcessing="true">
<match url="^(.*).html" />
<conditions logicalGrouping="MatchAny">
<add input="{URL}" pattern="(.*).html"  />
</conditions>
<action type="Redirect" url="{R:1}" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>

请确保IIS中安装了URL重写功能。

如果不可用,请单击右侧的“获取新的Web平台组件”,搜索“URL重写”并安装它。重新打开IIS管理器

单击您的站点并打开URL重写功能。您可以探索web.config文件中的重写规则