我需要在我的网站中隐藏任何类型的页面扩展,这些扩展已经托管了 100 多个页面 asp、html 和 aspx 页面。我想隐藏所有类型的页面扩展名。我使用以下仅适用于 .aspx 的代码。不适用于 .html 和 .asp 页面扩展
<rule name="RemoveASPX" enabled="true" stopProcessing="true">
<match url="(.*)\.aspx" />
<action type="Redirect" url="{R:1}" />
</rule>
<rule name="AddASPX" enabled="true">
<match url=".*" negate="false" />
<conditions>
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
<add input="{URL}" pattern="(.*)\.(.*)" negate="true" />
</conditions>
<action type="Rewrite" url="{R:0}.aspx" />
</rule>