无法访问 wp-admin [英] Unable to access wp-admin

查看:45
本文介绍了无法访问 wp-admin的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我意识到这个问题过去曾出现过,但我一直无法找到解决问题的方法.

I realized that this question has come up in the past, but I haven't been able to find the solution to my problem.

我的 wp-admin 在我的本地主机上运行良好.但是,当我迁移到我的实时服务器时,我无法再访问它.如果我确实转到 mysite/wp-admin,则会收到 404 错误.

My wp-admin works fine on my localhost. However, when I migrate to to my live server, I'm no longer able to access it. If I do go to mysite/wp-admin, I get a 404 error.

我尝试过的一些事情:

-通过重命名文件夹禁用所有插件- 一一删除插件- 改变主题- 编辑 wp-admin 文件夹的 755 权限- 将以下内容添加到我的 wp-config 文件中:

-Disabling all plugins by renaming the folder -Deleting plugins one by one -Changing themes -Editing permissions to 755 for wp-admin folder -Adding the below to my wp-config file:

define('WP_HOME','http://example.com');
define('WP_SITEURL','http://example.com');

请注意,当我添加这些行时,我收到此页面有重定向循环"的错误.

Note that when I add these lines I get an error that "this page has a redirect loop".

我使用了标准的 wordpress .htaccess 文件:

I used the standard wordpress .htaccess file:

# 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

有人知道可能是什么问题吗?欢迎提出任何想法.

Does anybody have any idea what the issue might be? Any ideas are welcome.

谢谢!

推荐答案

看起来您已经完成了标准的故障排除测试.尝试将以下行添加到活动主题的 functions.php 文件中.

It looks like you've done the standard troubleshooting tests. Try adding the following lines to your active theme's functions.php file.

function flush_my_rules() {

    flush_rewrite_rules();

}

add_action('init','flush_my_rules');

确保在 wp-config.php 文件中保留以下几行.

Make sure to keep the following lines in your wp-config.php file.

define('WP_HOME','http://example.com');
define('WP_SITEURL','http://example.com');

然后尝试先访问您的主页,然后再访问您的/wp-admin/页面.看看你是否继续得到 404.如果是,请尝试访问/wp-login.php 页面,看看通过那里登录是否继续返回 404.

Then try visiting your homepage first, then your /wp-admin/ page. See if you continue to get a 404. If you do, try visiting the /wp-login.php page, and see if logging in via there continues to return a 404.

这篇关于无法访问 wp-admin的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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