discuz开启https后 uc通信失败 的解决办法

discuz教程
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]

标签: