2012-02-27 119 views
2

我想完成這個使用web.config和它工作正常,當我有一個default.aspx文件,但我使用MVC,並沒有根.aspx文件。我怎麼能得到它去我的家庭控制器,然後索引視圖?ASP.NET MVC重定向非WWW到WWW並重寫爲小寫URL

<system.webServer> 
<rewrite> 
    <rules> 
    <rule name="Redirect to WWW" stopProcessing="true"> 
     <match url=".*" /> 
     <conditions> 
     <add input="{HTTP_HOST}" pattern="^mydomain.com$" /> 
     </conditions> 
     <action type="Redirect" url="http://www.mydomain.com/{R:0}" 
      redirectType="Permanent" /> 
    </rule> 
    <rule name="convert to lower case" stopProcessing="false"> 
<match url=".*[A-Z].*" ignoreCase="false"/> 
<conditions> 
<!-- The following condition prevents rule from rewriting requests to .axd files --> 
<add input="{URL}" negate="true" pattern="\.axd$"/> 
</conditions> 
<action type="Redirect" url="{toLower:{R:0}}" redirectType="Permanent"/> 
</rule> 
     </rules> 
    </rewrite> 
    <directoryBrowse enabled="false" /> 
    </system.webServer> 

有人告訴我,它不能列出目錄的內容,但是這不是它應該嘗試無論如何做。

回答