1
我有一个最初在IIS 7.5上开发的ASP.NET MVC4 web应用程序。 RouteConfig:iis8上的asp.net mvc4默认控制器
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
AreaRegistration.RegisterAllAreas();
routes.MapRoute(
name: "Default",
url: "{controller}/{action}/{id}",
defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }
);
AdminAreaRegistration:
context.MapRoute(
name: "Admin",
url: "Admin/{controller}/{action}/{id}",
defaults: new { controller = "AdminIndex", action = "Index", id = UrlParameter.Optional },
namespaces: new[] { "Web.Areas.Admin.Controllers" }
);
在IIS 7.5中的一切工作正常。在部署到IIS 8 url/Admin /返回错误403之后。但是,如果指定了控制器名称,它将起作用:/ Admin/AdminIndex /。有任何想法吗?提前致谢。
作为一个临时解决方案更新的web.config用: <添加URL = “〜/系统管理员” mappedUrl = “〜/管理/ AdminIndex”/> urlMappings> 它现在工作。 –
SergB
2013-05-03 10:08:25