So in IIS you can set the default document for all site folders to be say “index.aspx”.
In MVC how do I do this across a) all directories or failing that b) one directory at a time.
I have a page in [Views]/[Search]/[index.aspx]
This url works – http://www.[mysite]/search/index
but I can’t get it to work under – http://www.[mysite]/search
I have tried adding this into global.asax > RegisterRoutes
routes.MapRoute(
"Search",
"{action}",
new { controller = "Search", action = "Index" }
);
MVC doesn’t use a default document, but a default route.
Your route above shows us that the default page when someone visits your website (http://example.com) will be the
Indexview contained within thesearchdirectory.The default route that gets generated with a new MVC project looks like this
What this means is that your routing structure would look like