I have an asp.net mvc 2 application (using .net 4.0) that does not route correctly when placed in a virtual directory. I have the following simple routing rule:
routes.MapRoute(
"Default",
"{action}",
new { controller = "accounts" }
);
I am trying to resolve http://mydomain.com/accounts/new . Where "accounts" is a virtual directory. If I put the application in the root directory of the IIS site, it will be redirected to http://mydomain.com/new , but if I put the application in the virtual directory I get 404 errors. I debugged and it does global.asax and configures routing when in vdir. Is there anything special I need to do for routing in a virtual directory?
FYI. I use vdir because it has wordpress in it.
Thank!
one more thing is that if I specify the default action in the default options, it will execute the default action / controller, but it will never match another.
source
share