把Discuz!NT放在虚拟目录下

把网站设为IIS默认网站下的话,Discuz!NT访问路径是 http://localhost/bbs   不会出什么错,

但如果建个虚拟目录school 访问路径是 http://localhost/school/bbs 就会是空白的 

翻看了Discuz!NT的类库文件 ,估计是映射的路径不对.

下面是修改的几处地方:

1、Discuz.Config 类库中    BaseConfigFileManager类和BaseConfigProvider类里面修改filename的值


                    if (context != null)
                    {
                        filename = context.Server.MapPath("~/DNT.config");
                    }
              

2、Discuz.Forum.HttpModule  ReUrl_BeginRequest()方法里面 修改forumpath的值

     if(HttpRuntime.AppDomainAppVirtualPath=="/")
        forumPath = baseconfig.Forumpath.ToLower();
     else
        forumPath = HttpRuntime.AppDomainAppVirtualPath + baseconfig.Forumpath.ToLower();

3、Discuz.Forum.HttpModule     public class SiteUrls()类里面修改了SiteUrlsFile的值

string SiteUrlsFile = HttpContext.Current.Server.MapPath("~"+BaseConfigs.GetForumPath + "config/urls.config");

4、Discuz.Aggregation.AggregationData  里面修改了filepath的值 

private static string filepath = System.Web.HttpContext.Current.Server.MapPath("~"+BaseConfigs.GetForumPath + "config/aggregation.config");

5、Discuz.Common.Utiles里面   GetMapPath(string strPath)中修改了一下返回值

return HttpContext.Current.Server.MapPath("~"+strPath);

可能还有其它地方需要改,改的大都是路径

posted on 2008-09-23 16:18  叶子绿了  阅读(1331)  评论(0编辑  收藏  举报

导航