我不明白为什么这个问题一直无人接听了这么久,因为它是做的相当简单:
<rewrite>
<rules>
<rule name="Redirect to mypage.aspx" stopProcessing="true">
<match url=".*" />
<conditions logicalGrouping="MatchAll">
<add input="{HTTP_HOST}" pattern="domain\.com$" />
<add input="{REQUEST_URI}" pattern="^/mypage\.aspx/" negate="true"/>
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
</conditions>
<action type="Redirect" url="http://{HTTP_HOST}/mypage.aspx/{R:0}" appendQueryString="true" redirectType="Permanent" />
</rule>
</rules>
</rewrite>
希望这有助于。
编辑:制造它的动态,对现有文件/目录还增加了例外,否则静态内容将不再工作。
对不起,我是不是在清楚我的问题。 abcd可以是任何东西。 mypage.aspx将始终mypage.aspx。你有一个动态的ABCD的解决方案。 – 2014-12-23 16:26:02