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

相關文章
相關標籤/搜索