Setting Default WebPage in IIS 7.5

前端 未结 4 690
野的像风
野的像风 2020-12-17 04:12

I\'d a HD problem in machine where my Intranet IIS server was installed and I\'ve reinstalled all the software. I\'ve restored the site data into new IIS but now, when I typ

4条回答
  •  情歌与酒
    2020-12-17 04:42

    Had the same problem in MVC project where I have put a default.aspx in the root
    It was not enough to only set web.config

    
    
        
            
            
        
    
    
    

    Also had too add routes.IgnoreRoute(""); in RouteConfig.cs

        public static void RegisterRoutes(RouteCollection routes)
        {
            routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
            routes.IgnoreRoute("");
            routes.MapRoute(
                name: "Default",
                url: "{controller}/{action}/{id}",
                defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }
            );
        }
    

    I followed the guide: http://weblog.west-wind.com/posts/2013/Aug/15/IIS-Default-Documents-vs-ASPNET-MVC-Routes

提交回复
热议问题