cms icon indicating copy to clipboard operation
cms copied to clipboard

直接输入域名或者IP不能打开主站首页

Open onthewebcn opened this issue 9 years ago • 6 comments

运行环境 Windows 2012 R2 + MS SQL Server 2012

SiteServer版本 siteserver-dev-v5.0.63

问题描述 在生成主站的首页后,打开主站域名或者IP地址都出现如下错误提示: 该 XML 文件并未包含任何关联的样式信息。文档树显示如下。 <Error> <Message>No HTTP resource was found that matches the request URI 'http://www.xxxx.com/'.</Message> <MessageDetail>No route providing a controller name was found to match request URI 'http://www.xxxx.com/'</MessageDetail> </Error>

尝试排查问题 1、在域名或IP后面加/index.html可以正常显示; 2、IIS的默认文档设置无误; 3、将SiteServer站点绑定到其它非SiteServer目录,在其目录下新建index.html,直接用域名或IP可以打开; 4、子站无影响; 5、更换服务器,重装SiteServer(siteserver-dev-v5.0.59),问题依旧。 # #

onthewebcn avatar Jul 17 '17 16:07 onthewebcn

我也是这种情况,很郁闷

kingter520 avatar Aug 03 '17 04:08 kingter520

可以留下QQ联系方式。

wang11268440 avatar Aug 04 '17 04:08 wang11268440

QQ:12496785

kingter520 avatar Aug 12 '17 04:08 kingter520

因为我这边改成了mvc 方式,你们也改一下 通用 加上下面就可以了 Application_BeginRequest if (Context.Request.FilePath == "/") { if (File.Exists(AppDomain.CurrentDomain.BaseDirectory + "Index.html")) { Context.RewritePath("Index.html"); } else { Context.Response.Write("404.html"); } }

stuyun avatar Aug 15 '17 01:08 stuyun

在Global.cs 里加这一句代码就可以了 protected void Application_BeginRequest(object sender, EventArgs e) { if (Context.Request.FilePath == "/") Context.RewritePath("index.html"); }

BaoStorm avatar Sep 02 '17 10:09 BaoStorm

已解决。

starlying avatar Sep 20 '17 02:09 starlying