想要将Https重定向到WordPress中的http [英] Want to redirect Https to http in WordPress

查看:89
本文介绍了想要将Https重定向到WordPress中的http的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我只是尝试了每种方法,包括WordPress插件和htaccess,将HTTPS重定向到http。

I just tried every single method, including WordPress plugins and htaccess to redirect HTTPS to http. But nothign worked.

问题是我在今年年初购买了一个新域名,而我开始使用HTTP版本,但是上个月我知道了,该域名是在2010年使用的。那时,它与HTTPS一起使用,并且当时该网址中的某些网址仍在Google中建立了索引。

The thing is I Bought a new domain in the beginning of this year and i started using the HTTP version, but last month I got to know that, the domain was used in 2010. And that time it was used with HTTPS and some URL's of that time are still indexed in Google.

您可以在Google上键入这两种类型版本。

You can check on Google typing both type of versions.

http://www.theblackfridaycoupons.com/

https://www.theblackfridaycoupons.com/

任何机构对此都有解决方案吗?

Any body have solution for this? I only want HTTP version and want https to redirect to http.

推荐答案

只需要强制URL重定向到HTTP,就可以了。在主题文件夹内的index.php上,添加以下代码:

Just force the URL to redirect to HTTP; on your index.php inside the theme folder add the following code:

<?php if($_SERVER["HTTPS"] == "on"){
$location =  "http://" . $_SERVER["HTTP_HOST"] $_SERVER["REQUEST_URI"];
    wp_redirect($location);
exit();  
?>

这篇关于想要将Https重定向到WordPress中的http的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆