admin管理员组文章数量:1323335
My development computer recently had to be rebuilt so I am now trying to migrate a WordPress site from the hosting company to my development PC. So far I have done this:
Installed XAMPP.
Download the PHP files using FTP and put them in
htdocs\mysite
Create a virtual host called:
localhost.MySite
.Export the .sql from the host using PHPMyAdmin
Open the .sql and to a find and replace replacing:
www.mysite.co.uk
with:localhost.MySite
Use PHPMyAdmin on my local PC to load the .sql
Make changes to wp_config.php:
define('WP_HOME', 'http://localhost/mysite'); define('WP_SITEURL', 'http://localhost/mysite');
Everything appeared to work e.g. the multi sites; the admin panel etc. The only issue I have is when I logout of the admin panel; I am redirected to: /?loggedout=true
instead of: http://localhost.MySite/wp-login.php/?loggedout=true
. What can I do?
I have spent a while Googling this e.g. I have looked here: /
This issue does not happen on the live website.
Update
I only appear to have theis issue on the root site of the multi site.
My development computer recently had to be rebuilt so I am now trying to migrate a WordPress site from the hosting company to my development PC. So far I have done this:
Installed XAMPP.
Download the PHP files using FTP and put them in
htdocs\mysite
Create a virtual host called:
localhost.MySite
.Export the .sql from the host using PHPMyAdmin
Open the .sql and to a find and replace replacing:
www.mysite.co.uk
with:localhost.MySite
Use PHPMyAdmin on my local PC to load the .sql
Make changes to wp_config.php:
define('WP_HOME', 'http://localhost/mysite'); define('WP_SITEURL', 'http://localhost/mysite');
Everything appeared to work e.g. the multi sites; the admin panel etc. The only issue I have is when I logout of the admin panel; I am redirected to: http://wp-login.php/?loggedout=true
instead of: http://localhost.MySite/wp-login.php/?loggedout=true
. What can I do?
I have spent a while Googling this e.g. I have looked here: https://wordpress/support/topic/logout-redirect-not-working-3/page/2/
This issue does not happen on the live website.
Update
I only appear to have theis issue on the root site of the multi site.
Share Improve this question edited Sep 4, 2020 at 13:33 w0051977 asked Sep 4, 2020 at 11:28 w0051977w0051977 1214 bronze badges1 Answer
Reset to default 0I have traced the problem to this code in wp-login.php:
case 'logout' :
check_admin_referer('log-out');
$user = wp_get_current_user();
wp_logout();
echo "hello";
echo $_REQUEST['redirect_to'];
if ( ! empty( $_REQUEST['redirect_to'] ) ) {
$redirect_to = $requested_redirect_to = $_REQUEST['redirect_to'];
} else {
$redirect_to = 'wp-login.php?loggedout=true';
$requested_redirect_to = '';
}
It appears if I change this line:
$redirect_to = 'wp-login.php?loggedout=true';
to this:
$redirect_to = 'http://wp-login.php?loggedout=true';
Then it works as expected. Not sure why. In fact I can also change it to any of the following and it still works as expected:
$redirect_to = 'http://';
or
$redirect_to = 'http://somerandomsite';
Not sure what is going on.
本文标签: migrationWhy is the domain name missing from the logout redirect
版权声明:本文标题:migration - Why is the domain name missing from the logout redirect? 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742137036a2422415.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论