我正在尝试使用web.config完成此操作,当我有一个default.aspx文件但我使用MVC并且没有root .aspx文件时它工作正常。如何让它进入我的家庭控制器,然后转到索引视图?
<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>
它告诉我它无法列出目录的内容,但这不是它应该尝试做的事情。
答案 0 :(得分:4)