I'm debugging a route matching issue in ASP.NET MVC. The URL is defined like this: {foo}/Somewhere/{controller}/{action}/{id}. Each segment has a default value set up on the route.
When I try to browse http://hostname/bar/Somewhere the route matches. If I try http://hostname/Somewhere (thus, omitting foo segment), the route doesn't match.
I've installed routedebugger from Phil Haack and I can see that my defaults are correctly set up (controller = Home, action = Index, id = UrlParameter.Optional, foo = bar), but the route still does not match and I get a 404.
I tried to modify the route to have no "optionnal" segment before the "static" segment, like this: Somewhere/{controller}/{action}/{id}/{foo}. With this route, both url (http://hostname/Somewhere/bar and http://hostname/Somewhere) are working as expected.
Is there a limitation (or a bug) in MVC that I can't use an "optionnal" segement before an hard-coded one?
Thanks for your help, Fabian