redirect而不指定文件扩展名

专家们,我在过去两年在IIS上运行我的网站,在共享主机服务器上,redirect工作时没有指定文件扩展名。

使用下面的代码,我可以redirect到test.vbhtml。 似乎由于托pipe公司提供的国际空间站的一些变化,不再工作了。

Response.Redirect的(URL:= “testing”)

在扩展名添加到文件名,我看到页面被加载。 Response.Redirect的(URL:= “test.vbhtml”)

我的问题是:在IIS中需要什么configuration,以便它可以自动parsing文件扩展名?

感谢以下文章的作者,我可以解决这个问题。 为其他可能遇到同样问题的人发布解决scheme。

文章重写

<rewrite> <rules> <rule name="removeextension" 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}.vbhtml" /> </rule> </rules> </rewrite>