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>
有人告訴我,它不能列出目錄的內容,但是這不是它應該嘗試無論如何做。
我只是這樣做,這是我在那裏幾乎相同的東西。我重新發布了它,現在它可以工作...去圖。 – 2012-02-27 23:34:11
我會把這個標記爲答案,因爲它在這裏還有其他一些東西可以用在我身上。感謝那。 – 2012-02-27 23:35:10