字preSS - /可湿性粉剂管理员/重定向到/wp-login.php,登录的时候 [英] Wordpress - /wp-admin/ redirecting to /wp-login.php, when logged-in

查看:292
本文介绍了字preSS - /可湿性粉剂管理员/重定向到/wp-login.php,登录的时候的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在登录的可湿性粉剂管理员通过302重定向到 WP-login.php中

When logged-in wp-admin is redirecting to wp-login.php via 302.

有2行为:

1)用户名/密码是否正确。 302重定向到/可湿性粉剂管理员/后跟一个302重定向到/wp-login.php

1) Username/password correct. 302 redirect to /wp-admin/ followed by a 302 redirect to /wp-login.php

2)输入的用户名/密码是错误的,没有重定向。 200响应以错误:不正确的用户名和密码。显示。

2) Username/Password entered is wrong, no redirect. 200 response with "ERROR: Incorrect username or password." displayed.

字preSS配置(我已经替换为真实域名testdomain.com):

Wordpress configuration (I've replaced the real domain with "testdomain.com"):

$_SERVER['HTTPS']='on';

define( 'FORCE_SSL_LOGIN', false );
define( 'FORCE_SSL_ADMIN', false );

if ( !defined('ABSPATH') )
    define('ABSPATH', dirname(__FILE__) . '/');

//$currenthost = "https://".$_SERVER['HTTP_HOST'];
$currenthost = "https://exampledomain.com";
$currentpath = preg_replace('@/+$@','',dirname($_SERVER['SCRIPT_NAME']));
$currentpath = preg_replace('/\/wp.+/','',$currentpath);
define('WP_HOME',$currenthost.$currentpath);
define('WP_SITEURL',$currenthost.$currentpath);
define('WP_CONTENT_URL', $currenthost.$currentpath.'/wp-content');
define('WP_PLUGIN_URL', $currenthost.$currentpath.'/wp-content/plugins');
define('DOMAIN_CURRENT_SITE', $currenthost.$currentpath );
define('ADMIN_COOKIE_PATH', './');
define('WP_BASE', $currenthost.$currentpath);
define('FS_METHOD', 'direct');
define('FS_CHMOD_DIR', (0705 & ~ umask()));
define('FS_CHMOD_FILE', (0604 & ~ umask()));


任何想法?


Any ideas?

推荐答案

如果您确信您的登录凭据是正确的,你可以使用wp_authenticate钩如下:

If you are sure that your login credentials are correct, you can make use of the "wp_authenticate" hook as follows:

add_action('wp_authenticate', 'mysite_check_already_logged_in');

function mysite_check_already_logged_in() {

    if (is_user_logged_in()) {
        wp_redirect(site_url('wp-admin'));
    }
}

这篇关于字preSS - /可湿性粉剂管理员/重定向到/wp-login.php,登录的时候的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆