Link to home
Start Free TrialLog in
Avatar of M_O_J_O
M_O_J_OFlag for Denmark

asked on

MVC routing problem … need to type /home

Hi all,

My MVC3 website on my production Windows Server 2008 R2 (SP1) is bugging me and I need your help.

If I type ... http://www.mywebsite.com ... it shows me the IIS7.5 Welcome Screen. But if I type http://www.mywebsite.com/home ... then everything works fine.

Here's my global.asax:

Public Class MvcApplication
    Inherits System.Web.HttpApplication

    Shared Sub RegisterGlobalFilters(ByVal filters As GlobalFilterCollection)
        filters.Add(New HandleErrorAttribute())
    End Sub

    Shared Sub RegisterRoutes(ByVal routes As RouteCollection)
        routes.IgnoreRoute("{resource}.axd/{*pathInfo}")
        ' MapRoute takes the following parameters, in order:
        ' (1) Route name
        ' (2) URL with parameters
        ' (3) Parameter defaults
        routes.MapRoute( _
            "Default", _
            "{controller}/{action}/{id}", _
            New With {.controller = "Home", .action = "Index", .id = UrlParameter.Optional} _
        )
    End Sub

    Sub Application_Start()
        AreaRegistration.RegisterAllAreas()
        RegisterGlobalFilters(GlobalFilters.Filters)
        RegisterRoutes(RouteTable.Routes)
    End Sub

End Class

Open in new window


I tried aspnet_regiis -ir, but that didn't help.

Any idea why it doesn't work without the /home ???

Thanks!!

Mojo
SOLUTION
Avatar of Carl Tawn
Carl Tawn
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of M_O_J_O

ASKER

Just read my comment.