I have an MVC4 website running fine on dev. When trying to publish to production routing doesn't work. The only rule I have is the default:
routes.MapRoute(
name: "Default",
url: "{controller}/{action}/{id}",
defaults: new { controller = "General", action = "Index", id = UrlParameter.Optional }
);
However, on production server (IIS7.5 - just like dev) any of the following fails on 404:
<domain>/Home
<domain>/Home/Index
Plain <domain>/
fails on 403.
NOTE: All this while using route debugger
Playing around I stumbled upon the following curiosity:
<domain>/Home/Index.cshtml/3
Actually brought me to the route debugging page, claiming to match on
controller Home
action Index.cshtml
id 61
More playing showed that it doesn't matter where the ".cshtml" is, it works as long as it's there. e.g. <domain>/.cshtml/Index/4
matched
controller .cshtml
action Index
id 4
Why would it require a ".cshtml" string, and what can I do about it?