• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 522
  • 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)
        ' 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()
    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 ???


  • 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.
M_O_J_OAuthor Commented:
Reinstalled the server and problem dissapeared.
M_O_J_OAuthor Commented:
Just read my comment.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

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