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 @   94cool  阅读(2134)  评论(0编辑  收藏  举报
努力加载评论中...
点击右上角即可分享
微信分享提示