【发布时间】:2009-09-29 09:37:11
【问题描述】:
我预计这也会像 http://localhost/ 那样映射默认主页,但它没有被命中。
RouteTable.Routes.Add(new Route("{Keyword}", new HomeHandler()));
问题当然是为什么不呢?我想将根映射到其他页面。
【问题讨论】:
-
你能展示你完整的路由表吗?
我预计这也会像 http://localhost/ 那样映射默认主页,但它没有被命中。
RouteTable.Routes.Add(new Route("{Keyword}", new HomeHandler()));
问题当然是为什么不呢?我想将根映射到其他页面。
【问题讨论】:
我还没有尝试过,但尝试从 IIS 的配置中删除默认文档。对于 IIS 7,此设置位于 web.config:
<configuration>
<system.webServer>
<defaultDocument>
<files>
<clear />
</files>
</defaultDocument>
</system.webServer>
</configuration>
【讨论】:
答案有些复杂。它在 IIS6 上,我们必须添加一个特定的属性。我真的不记得我们当时做了什么,但你可以用谷歌搜索,我就是这样找到的。
【讨论】: