.NET Url重写根URL

Ivo*_*Ivo 4 iis-7 url-rewriting

我在IIS7中有以下规则:

    <rule name="RewriteAll" stopProcessing="true">
      <match url="^([^/]+)/?$" />
      <conditions>
        <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
        <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
        <add input="{URL}" negate="true" pattern="\.axd$" />
        <add input="{URL}" negate="true" pattern="\.png$" />
        <add input="{URL}" negate="true" pattern="\.gif$" />
        <add input="{URL}" negate="true" pattern="\.jpg$" />
        <add input="{URL}" negate="true" pattern="\.css$" />
        <add input="{URL}" negate="true" pattern="\.js$" />
      </conditions>
      <action type="Rewrite" url="default.aspx?page={R:1}" />
    </rule>
Run Code Online (Sandbox Code Playgroud)

那个抓住网址如http://mysite.com/contact/

我无法弄清楚使用规则来捕捉 http://mysite.com/并发送到例如home.aspx.任何人都可以帮助我匹配正则表达式

Ivo*_*Ivo 15

我通过添加以下规则修复它:

 <rule name="Index Request" enabled="true" stopProcessing="true">
     <match url="^$" />
     <action type="Rewrite" url="index.aspx" logRewrittenUrl="true" />
 </rule>
Run Code Online (Sandbox Code Playgroud)