How to force asp.net MVC 2 to redirect to default controller/action
- by Chris
In a brand new ASP.NET MVC2 project, I want the user to be redirected to
http://<mysite>/home/index
rather than
http://<mysite>/
We do this with our other sites for tracking purposes, to avoid the scenario where hits to the same default page show up as
http://<mysite>/
http://<mysite>/default.aspx
How do I accomplish this so that http://<mysite>/ automatically redirects to whatever default controller/action I have set up in my routing? Please note that I am aware the two are functionally equivalent, as the default controller action will be executed either way. I'm just interested in forcing consistent URLs in the browser.