如何在WordPress/Woocommerce中禁用自动https重定向?

我已经安装了一个wordpress + woocommerce网站。所有页面均使用https。我该如何避免呢?我只需要http。

编辑:在wp_options表中, 我将’home_url’和’base_url’都设置为以phpMyAdmin中的http开头。但这是行不通的。为什么呢


#1


无论如何要更改和重定向https页面, 你需要在函数内部使用以下内容。

function force_http () {

  if ( is_ssl() ) {
    wp_redirect('http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'], 301 );
    exit();
  }
}
add_action ( 'template_redirect', 'force_http', 1 );

来源:

https://www.srcmini02.com/66537.html

微信公众号
手机浏览(小程序)

Warning: get_headers(): SSL operation failed with code 1. OpenSSL Error messages: error:14090086:SSL routines:ssl3_get_server_certificate:certificate verify failed in /mydata/web/wwwshanhubei/web/wp-content/themes/shanhuke/single.php on line 57

Warning: get_headers(): Failed to enable crypto in /mydata/web/wwwshanhubei/web/wp-content/themes/shanhuke/single.php on line 57

Warning: get_headers(https://static.shanhubei.com/qrcode/qrcode_viewid_40437.jpg): failed to open stream: operation failed in /mydata/web/wwwshanhubei/web/wp-content/themes/shanhuke/single.php on line 57
0
分享到:
没有账号? 忘记密码?