IIS 设置默认首页静态页,无静态页,走路由

在Global.asax文件中添加

protected void Application_BeginRequest(Object sender, EventArgs e)
        {
            if (Context.Request.FilePath == "/") Context.RewritePath("index.html");
        }


在访问www.test.com时有index.html就是index.html,没有时就自动路由规则去了

posted @ 2016-11-11 12:02  94cool  阅读(2129)  评论(0编辑  收藏  举报