客户从别处将wordpess网站搬家到乐道澳门w88.com的内,并安装了SSL证书和更换了域名,网站程序和数据库都上传后访问域名出现错误提示:将您重定向的次数过多。
解决方法:
打开wp-includes/load.php文件,将ssl函数修改,将图1中的代码修改为图2即可。
代码如下:
function is_ssl() {
if ( isset( $_SERVER[‘HTTPS’] ) ) {
if ( ‘on’ == strtolower( $_SERVER[‘HTTPS’] ) ) {
return true;
}
if ( ‘1’ == $_SERVER[‘HTTPS’] ) {
return true;
}
} elseif ( isset($_SERVER[‘SERVER_PORT’] ) && ( ‘443’ == $_SERVER[‘SERVER_PORT’] ) ) {
return true;
}
return false;
}
修改为:
function is_ssl() {
if ( isset( $_SERVER[‘HTTPS’] ) ) {
if ( ‘on’ == strtolower( $_SERVER[‘HTTPS’] ) ) {
return true;
}
if ( ‘1’ == $_SERVER[‘HTTPS’] ) {
return true;
}
} elseif ( isset($_SERVER[‘SERVER_PORT’] ) && ( ‘443’ == $_SERVER[‘SERVER_PORT’] ) ) {
return true;
} elseif (isset($_SERVER[“HTTP_FROM_HTTPS”])&&$_SERVER[“HTTP_FROM_HTTPS”]==’on’){
return true;
}
return false;
}