phpcms v9 站群建站时子站点栏目页和内容页的url静态时,链接地址全使用的主站域名 已测试使用如下方法解决:
找到 phpcms/modules/content/classes/url.class.php 打开它,找到83行:$url_arr[0] = WEB_PATH == '/' ? $match_url.$html_root.'/'.$urls : $match_url.rtrim(WEB_PATH,'/').$html_root.'/'.$urls;
改为:
- $this->sitedb = pc_base::load_model('site_model');
- $siteid = param::get_cookie('siteid');
- $siteinfo = $this->sitedb->get_one(array('siteid'=>$siteid));
- $url_arr[0] = $siteinfo['domain'].$urls;
找到89行:$url_arr[0] = $url_arr[1] = APP_PATH.$urls;
改为:
- $this->sitedb = pc_base::load_model('site_model');
- $siteid = param::get_cookie('siteid'); //Vevb.com
- $siteinfo = $this->sitedb->get_one(array('siteid'=>$siteid));
- $url_arr[0] = $url_arr[1] = $siteinfo['domain'].$urls;
新闻热点
疑难解答