WordPress登录后台重定向次数过多的解决办法/ WordPress mixed content & redirected too many times

https://cloud.tencent.com/developer/article/1657681

如果你新安装的一个wordpress站点配置https后,再登录wordpress后台,却无法访问后台了[同时也可能会产生页面显示异常,F12会提示内容混杂,mixed content: the page at ” was loaded over https, but requested an insecure script ”. this request has been blocked; the content must be served over https.]。页面提示:将您重定向的次数过多,怎么办呢?

SEOSIR在这里为您分享wordpress网站开启https后台提示将您重定向的次数过多的解决方法如下:

你只需要在网站根目录的php文件wp-config.php开头加入以下代码,即可完美解决此问题了:

$_SERVER['HTTPS'] = 'on';
define('FORCE_SSL_LOGIN', true);
define('FORCE_SSL_ADMIN', true);

English Ver.

Under https environments, wordpress may be abnormal while loading resources, chrome inspection [F12] may indicate mixed content: the page at ” was loaded over https, but requested an insecure script ”. this request has been blocked; the content must be served over https.

And the login page shows redirected too many times

this is caused by the https configuration in the wordpress, you can add the following code in the wo-config.php file.

$_SERVER['HTTPS'] = 'on';
define('FORCE_SSL_LOGIN', true);
define('FORCE_SSL_ADMIN', true);

复制

Leave a Reply

Your email address will not be published. Required fields are marked *