discuz缓存中动态生成的域名地址

因为要从不一样地址访问discuz并生成缓存,动态获取来源并写入缓存文件中就成为了问题,通过兄弟们的努力寻找,终于最后找到了代码修改处(写死就行)php

 

文件 source\class\discuz\discuz_application.php 中的第178行:html

 

$_G['siteurl'] = dhtmlspecialchars(' http://'.$_SERVER['HTTP_HOST'].$sitepath.'/'); 

能够对其中$_SERVER['HTTP_HOST']作文章,改为写死的一个域名,好比改为缓存

 $tmpurl = ' www.abc.cn';
$_G['siteurl'] = dhtmlspecialchars(' http://'.$tmpurl.$sitepath.'/');
 
再把下面这行取端口号的注释掉
//$_G['siteport'] = empty($_SERVER['SERVER_PORT']) || $_SERVER['SERVER_PORT'] == '80' ? ''
         //   : ':'.$_SERVER['SERVER_PORT']; 

而后添加一行写死成80端口app

$_G['siteport'] = '80';
ide

相关文章
相关标签/搜索