[英]Wordpress: http / https hyperlink problem
An admin input field on a website I'm working on has https://url.co.uk in it, but is outputted on the frontend as just http://url.co.uk .我正在处理的网站上的管理员输入字段中有https://url.co.uk ,但在前端输出为http://url.co.uk 。 Any Ideas as to why this is happening?
关于为什么会发生这种情况的任何想法?
I think the links in the database/wp-config are still in http.我认为 database/wp-config 中的链接仍然在 http 中。
You can do 3 things:你可以做三件事:
Force https through .htaccess : https://help.dreamhost.com/hc/en-us/articles/215747758-Force-your-site-to-load-securely-with-an-htaccess-file通过 .htaccess 强制 https : https://help.dreamhost.com/hc/en-us/articles/215747758-Force-your-site-to-load-securely-with-an-htaccess-file
get a plugin to force https: https://wordpress.org/plugins/wp-force-ssl/获取一个插件来强制 https:https: //wordpress.org/plugins/wp-force-ssl/
Replace the http links to https in the DB and force https (step 1): https://github.com/interconnectit/Search-Replace-DB Use this to get it done将 http 链接替换为 DB 中的 https 并强制使用 https(步骤 1): https : //github.com/interconnectit/Search-Replace-DB使用它来完成它
If this isn't the case, try to clear your cache如果不是这种情况,请尝试清除缓存
Please use the bellow code at your wp-config.php to avoid http/https issue :请使用 wp-config.php 中的波纹管代码来避免 http/https 问题:
if (isset($_SERVER["HTTP_X_FORWARDED_PROTO"] ) && "https" == $_SERVER["HTTP_X_FORWARDED_PROTO"] ) {
$_SERVER["HTTPS"] = "on";
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.