最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

options - Logout redirects to a broken page(home URL is omitted)

programmeradmin1浏览0评论

I'm using the latest version of WP. I have a problem, where clicking the logout button from the admin panel redirects to a completely broken link:

/?loggedout=true

As you can see, the domain is completely omitted from the link(in my case it's wp.localhost)

I will mention that this local WP site was "cloned" from a remote server, but i made sure to change the "siteurl" and "home" fields in the wp_options table, and everything else works just fine

Can somebody tell me, where the problem might be? Is there any other configuration field, that might be relevant to this?

I'm using the latest version of WP. I have a problem, where clicking the logout button from the admin panel redirects to a completely broken link:

http://wp-login.php/?loggedout=true

As you can see, the domain is completely omitted from the link(in my case it's wp.localhost)

I will mention that this local WP site was "cloned" from a remote server, but i made sure to change the "siteurl" and "home" fields in the wp_options table, and everything else works just fine

Can somebody tell me, where the problem might be? Is there any other configuration field, that might be relevant to this?

Share Improve this question asked Sep 12, 2019 at 9:40 i.brodi.brod 1357 bronze badges 9
  • Have you tried deactivating all plugins and/or switching to a default theme? Have you checked the wp-config.php file for special settings like WP_SITEURL? How about your .htaccess file - anything that's suspicious? – Sally CJ Commented Sep 12, 2019 at 13:12
  • When you cloned the site, did you use a database migration plugin? Just changing those two options in the database isn't usually enough. – WebElaine Commented Sep 12, 2019 at 14:09
  • Sally CJ: Deactivating plugins and switching to the default theme didn't help. Also i didn't see anything suspicious in .htaccess or wp-config.php. WebElaine: I didn't use migration tool. I just exported and imported my WP database. I think i also changed something besides those two options, but i don't remember what. Any ideas? – i.brod Commented Sep 12, 2019 at 22:26
  • "clicking the logout button" - right-click on the button/link and inspect the HTML - does it point to the proper URL? If yes, which button exactly is that (screenshot will help)? – Sally CJ Commented Sep 13, 2019 at 0:54
  • It's pointing to "wp.localhost/wp-login.php?action=logout..." I think the problem is in the redirecting that occurs AFTER the logout operation was successful, because clicking this link DOES invalidate the session, and i need to login again. I tried to follow the execution stack using XDEBUG, but didn't manage to pick up any clues... – i.brod Commented Sep 13, 2019 at 11:01
 |  Show 4 more comments

1 Answer 1

Reset to default 2

Found the answer. It is a bug in WordPress v5.2.3 affecting WordPress in Windows environments. Caused by backslashes in Windows paths that aren't stripped correctly

Details here: https://core.trac.wordpress/ticket/47980

I have tried the patch suggested and can confirm it solves the problem.

replace:

$location = '/' . ltrim( $path . '/', '/' ) . $location;

with

$location = '/' . ltrim( $path . '/', '/\\' ) . $location;

in /wp-includes/pluggable.php, line 1404

It says it will be fixed in version 5.2.4

发布评论

评论列表(0)

  1. 暂无评论