• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 520
  • Last Modified:

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
0
M_O_J_O
Asked:
M_O_J_O
  • 2
2 Solutions
 
Carl TawnSystems and Integration DeveloperCommented:
It may be that the default files in the root of the site are taking precedence over the route. Try removing any HTML and ASP/X files from the root of your website.
0
 
M_O_J_OAuthor Commented:
Reinstalled the server and problem dissapeared.
0
 
M_O_J_OAuthor Commented:
Just read my comment.
0

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now