无法访问Wordpress后端

时间:2018-11-28 10:48:49

标签: wordpress login backend

我真的有一个难题。我突然无法进入我的两个网站的后端。当我转到/wp-login.php并登录时,它只是重定向到主页,但我没有登录。我什么也没碰,并且自动更新已关闭。 现在这是个难题:我已经删除了所有文件,并且数据库在上个月的备份中一直停留在备份上,一切正常。但这并不能解决问题!哪种原因使我认为问题出在服务器级别。 我还发现奇怪的是,它同时发生在两个网站上。还有其他人对此问题有任何建议吗?在Google上找不到新的东西,只有旧的东西。 感谢您的任何事先帮助!

Edit1:这是我的.htaccess

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . index.php [L]
</IfModule>
# END WordPress

1 个答案:

答案 0 :(得分:0)

主题核心文件functions.php

中的更改
// Block Access to /wp-admin for non admins.
function custom_blockusers_init() {
  if ( is_user_logged_in() && is_admin() && !current_user_can( 'administrator' ) ) {
    wp_redirect( home_url() );
    exit;
  }
}
add_action( 'init', 'custom_blockusers_init' ); // Hook into 'init'

您所要做的就是添加自己的角色能力,例如:!current_user_can( 'manage-reports' )