gpt4 book ai didi

php - 切换到 SSL 后无法登录我的 wp-admin

转载 作者:可可西里 更新时间:2023-11-01 12:40:54 26 4
gpt4 key购买 nike

我最近为我的 wordpress 站点(http 到 https)安装了 SSL 证书,现在我无法访问 Wordpress 管理。它刷新了页面,但我没有登录。

是否有什么我忘记更改我的 wordpress 文件的地方?

我检查了代码,登录表单指向我的旧站点(http 站点),当我查看文件中的代码时,表单操作设置为 site_url(),但我似乎找不到定义的地方。

最佳答案

我在 NearlyFreeSpeech.net 上的网站遇到了完全相同的问题,解决方案并不像修复网站 URL 那样简单。那没有区别。

我案例中的根本问题和解决方案已在下面复制的帖子中进行了解释。请注意,在我的系统上,SSL 错误造成了两个问题,一个是在 Stack Overflow 上描述的(wp-login 刷新而不登录)和 WP 加载样式表失败,这是下面引用的论坛帖子中实际解决的问题.帖子中的解决方案解决了两个问题。

What you describe sounds like the browser refusing to load the stylesheet, which typically happens when first creating an HTTPS-enabled WordPress site or adding SSL/TLS to an existing WP site.

WordPress isn't very smart about "reverse proxies" like what NFSN uses, where the user hits an outer web server that then talks to an inner application server where WordPress actually lives.

If you think you have an SSL-enabled site, especially if it's a new one, this could be your problem. You would need to edit your wp-config.php file to add the following:

if ($_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https')
$_SERVER['HTTPS']='on';

just above the "That's all, stop editing! Happy blogging!" lines.

Conversely, if you don't think you are using SSL on your site, this won't do anything. Check the alias for your site on the NFSN site control panel. If you see a padlock, you're set up in NFSN and need the code above.

WordPress's implementation of SSL is kind of a botch. It not only doesn't recognize SSL under environments like ours - it also is prone to redirect loops if everything isn't changed in exactly the right order. If the code above causes a site outage - you keep getting complaints from the browser about redirect loops - then remove the code and ask again. I'll see if I can find my notes about how to do initial SSL setup.

关于php - 切换到 SSL 后无法登录我的 wp-admin,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15238288/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com