ASP.NET url routing, default path
-
18-09-2019 - |
Question
I expected this would also map the default homepage as in http://localhost/ but it is not hit.
RouteTable.Routes.Add(new Route("{Keyword}", new HomeHandler()));
Question is of course why not? I would like to map the root to some other page.
Solution
I haven't tried this yet but try removing the default document from IIS's configuration. For IIS 7 this setting is in web.config
:
<configuration>
<system.webServer>
<defaultDocument>
<files>
<clear />
</files>
</defaultDocument>
</system.webServer>
</configuration>
OTHER TIPS
The answer is somewhat complex. It was on IIS6 and we had to add a specific property. I cannot really remember what we did back then but you can google it, that's how I found it.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow