论坛升级到Discuz x2.5版本后,开启CDN后出现帖子地址添加了端口:37001,帖子页和内容页都在首页域名后面添加了端口,下面分享下Discuz X2.5论坛出现37001的解决办法。
Discuz X2.5用户:打开文件sourceclassdiscuzdiscuz_application.php,查找第223行或如下代码
$_G[‘siteport’] = empty($_SERVER[‘SERVER_PORT’]) || $_SERVER[‘SERVER_PORT’] == ’80’ ? ” : ‘:’.$_SERVER[‘SERVER_PORT’];
修改为:
//$_G[‘siteport’] = empty($_SERVER[‘SERVER_PORT’]) || $_SERVER[‘SERVER_PORT’] == ’80’ ? ” : ‘:’.$_SERVER[‘SERVER_PORT’];
覆盖原文件后更新缓存即可解决。
Discuz X1.5用户,打开文件source/function/function_core.php,查找第1025行或如下代码:
$port = empty($_SERVER[‘SERVER_PORT’]) || $_SERVER[‘SERVER_PORT’] == ’80’ ? ” : ‘:’.$_SERVER[‘SERVER_PORT’];
修改成
//$port = empty($_SERVER[‘SERVER_PORT’]) || $_SERVER[‘SERVER_PORT’] == ’80’ ? ” : ‘:’.$_SERVER[‘SERVER_PORT’];
覆盖原文件后更新缓存即可解决。
Discuz X2用户,打开文件source/class/class_core.php,查找第359行或如下代码:
$_G[‘siteport’] = empty($_SERVER[‘SERVER_PORT’]) || $_SERVER[‘SERVER_PORT’] == ’80’ ? ” : ‘:’.$_SERVER[‘SERVER_PORT’];
修改成
//$_G[‘siteport’] = empty($_SERVER[‘SERVER_PORT’]) || $_SERVER[‘SERVER_PORT’] == ’80’ ? ” : ‘:’.$_SERVER[‘SERVER_PORT’];
覆盖原文件后更新缓存即可解决。