[英]Wordpress https 'redirected you too many times.' error
I am hosting a wordpress site on AWS and am transitioning from http to https. 我正在AWS上托管一个wordpress网站,并且正在从http转换为https。 After reading some resources from online I added this line to the
wp-config.php
file: 从在线阅读一些资源后,我将此行添加到
wp-config.php
文件中:
define('FORCE_SSL_ADMIN', true);
Now when i try to access the /wp-admin/
page I get the xx.xx.com redirected you too many times
. 现在,当我尝试访问
/wp-admin/
页面时,我得到xx.xx.com redirected you too many times
。 The all of the other pages work, it is only the admin panel that is not working. 所有其他页面都工作,只有管理面板不起作用。
For anyone coming here like me being behind a reverse proxy that handle the SSL stuff, it took me a while but I could find the documentation where it states what has to be done: 对于像我一样来到这里的任何人都是在处理SSL内容的反向代理之后,它花了我一段时间,但我可以找到文档,说明必须做什么:
https://codex.wordpress.org/Administration_Over_SSL https://codex.wordpress.org/Administration_Over_SSL
It states to add an if in the wp-config: 它声明在wp-config中添加一个if:
// in some setups HTTP_X_FORWARDED_PROTO might contain
// a comma-separated list e.g. http,https
// so check for https existence
if (strpos($_SERVER['HTTP_X_FORWARDED_PROTO'], 'https') !== false)
$_SERVER['HTTPS']='on';
As I don't like to touch the config (mostly because I forget I touched it) I tried to find a more elegant way of doing it: 因为我不喜欢触摸配置(主要是因为我忘记了触摸它)我试图找到一种更优雅的方式:
https://wordpress.org/plugins/ssl-insecure-content-fixer/ https://wordpress.org/plugins/ssl-insecure-content-fixer/
I have tried with this plugin and it works. 我试过这个插件,它的工作原理。
It happened to me sometimes. 有时发生在我身上。 Try checking between which pages the redirect occurs here: redirect-checker.org It will help you understand why it happens
尝试检查重定向发生在哪些页面之间: redirect-checker.org它将帮助您理解它发生的原因
If the problem is about a loop between http://example.com and https://example.com you can try changing homeurl and siteurl to avoid this redirect. 如果问题是关于http://example.com和https://example.com之间的循环,您可以尝试更改homeurl和siteurl以避免此重定向。 You can do this:
你可以这样做:
define('WP_HOME','http://example.com'); define('WP_SITEURL','http://example.com');
define('WP_HOME','http://example.com'); define('WP_SITEURL','http://example.com');
define('WP_HOME','http://example.com'); define('WP_SITEURL','http://example.com');
in wp-config.php (check here ) Hope it helps 希望能帮助到你
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.