discuz开启https后 uc通信失败 的解决办法
类别:建站知识   时间:10-12

DISCUZ x3.2 开启https后ucenter通信失败解决方法(301重定向https后通信失败 按此办法处理)
uc目录model/misc.php

搜索
$port = !empty($matches['port']) ? $matches['port'] : 80;

68行处后面加入以下代码

if(substr($url,0,5)=='https'){$ch = curl_init($url);curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);if($post){curl_setopt($ch, CURLOPT_POST, 1);curl_setopt($ch, CURLOPT_POSTFIELDS, $post);}if($cookie){curl_setopt($ch, CURLOPT_COOKIE, $cookie);}curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);return curl_exec($ch);}

.htaccess 伪静态规则 里面添加下面的规则 即可实现跳转

# RewriteCond %{SERVER_PORT} !^443$
# RewriteRule ^.*$ https://%{SERVER_NAME}%{REQUEST_URI} [L,R=301]

智慧半岛,是一家专注于青岛网站建设青岛网站开发的青岛网络公司,Copyright ©2007-2019 Ebandao.Cn 版权所有 All Rights Reserved.(建议在1366x768以上的浏览器中访问)鲁ICP备08014496号

13153297890