ASP.NET URL Routing, Default Path

I expected this to also display the default homepage as in http: // localhost / , but that won't hit.

RouteTable.Routes.Add(new Route("{Keyword}", new HomeHandler()));

      

The question is, of course, why not? I would like to map the root to another page.

+2


source to share


2 answers


I haven't tried this yet, but will try to remove the default document from IIS config. For IIS 7, this parameter is located in web.config

:



<configuration>
 <system.webServer>
  <defaultDocument>
   <files>
    <clear />
   </files>
  </defaultDocument>
 </system.webServer>
</configuration>

      

+2


source


The answer is somewhat complex. This was on IIS6 and we had to add a specific property. I can't remember what we did then, but you can do it the way I found it.



+1


source







All Articles