getting rid of "Home" in the url

Last post 05-12-2008 3:57 PM by joecar. 1 replies.

Sort Posts:

  • getting rid of "Home" in the url

    05-08-2008, 8:34 PM

    When you create a sample Mvc app, the default url for the home page looks like "http://localhost:1797/Home "  Does anyone know how to rewrite the url that the user sees so that it appears as "http://localhost:1797". I've tried using an HttpModule and using routing rules to no avail.

    Thanks

    Filed under:
  • Re: getting rid of "Home" in the url

    05-12-2008, 3:57 PM
    • Loading...
    • joecar
    • Joined on 03-05-2007, 12:35 PM
    • Posts 48

    Which version of mvc do you have installed? If it is the codeplex version, then you are likely running into this issue:

     http://haacked.com/archive/2008/04/10/upcoming-changes-in-routing.aspx

    " You’ll notice that the readme recommends having a Default.aspx file in the root which redirects to /Home. Technically, the Default.aspx file in the root won’t be necessary in the final release because of the suggested routing changes (it is necessary now due to a minor bug). Unfortunately, Cassini doesn’t work correctly when you make a request for "/" and there is no default document. It doesn’t run any of the ASP.NET Modules. So we kept the file in the root, but you can will be able to remove it when deploying to IIS 7. So to recap this last point, the Default.aspx in the project root is to make sure that Cassini works correctly. It's will not be needed for IIS 7 in the future, but is needed for the time being. "

     

    The default.aspx pages code behind redirects to home which is why you are not browsing to the root when using cassini.

Page 1 of 1 (2 items)