WordPress网站维护教程:WordPress登陆不了后台的解决方法

继续分享wordpress网站维护教程。有部分用户发现wordpress 网站登陆不了后台。

如上图所示,使用域名/wp-admin这个地址登陆wordpress建站后台时会提500错误。此时网站的前台浏览是正常的,每个页面都可以正常打开。(也有部分是前台页面也打不开)

这个错误的临时解决方法是换一个登陆地址:域名/wp-login.php,我们可以直接使用这个地址登陆wordpress后台。

接下来我们开始处理问题。悦然wordpress建站根据这段时间处理此类问题的经验,总结出以下两个可能的原因。

.Htaccess文件丢失/被覆盖

.htaccess文件是用来管理网站伪静态和301跳转的,有部分人的网站在升级wordpress 6.0.1后出现了.htaccess文件被清空,或者是被覆盖的问题,如果是这个问题,那么重新创建一个.htaccess文件,然后添加正确的301跳转和伪静态规则就可以了。

总结下来出现此类问题的原因如下:

1.误操作.htaccess文件。这个概率比较小,但确实存在,如果你的wordress网站安装了wpfile或rank math seo这类插件,它们是可以直接编辑网站.htaccess文件的,操作不当就可能出问题。

# The directives (lines) between “BEGIN WordPress” and “END WordPress” are

# dynamically generated, and should only be modified via WordPress filters.

# Any changes to the directives between these markers will be overwritten.

2【.htaccess文件】被wordpress自动覆盖。有部分使用虚拟主机的用户在升级wordpress6.0.1之后就会出现此类问题,如果升级之后在后台编辑了.htaccess文件,或者和是点击后台【设置】-【固定链接】,此时不管你有没有进行修改,wordpress都有可能会自动给你覆盖为默认的.htaccess文件,覆盖掉你原来的设置。如果你仔细观察.htaccess文件中的内容,可能会发现上面的提示,大意就是说只要你修改了这部分内容,它都会被自动替换为默认值。

解决方法很简单,我们只需要重新在.htaccess文件中填写伪静态和301跳转规则就可以了,保存之后即可恢复正常。

预防:如果你的网站反复出现此类问题,那么可调整一下.htaccess文件的写法。

首先我们把wordpress固定的伪静态内容添加到.htaccess文件的开头部分,并且这一部分不要去动它,如下图所示:

# BEGIN WordPress
# The directives (lines) between "BEGIN WordPress" and "END WordPress" are
# dynamically generated, and should only be modified via WordPress filters.
# Any changes to the directives between these markers will be overwritten.
<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

然后额外的伪静态设置、301跳转设置、主机商提供的一些缓存设置等都添加到【# END WordPress】之后。这样就可以。

Wp-Admin/Index.Php文件被锁定

如上图所示,悦然wordpress建站遇到的两个/wp-admin打不开的问题都是wp-admin目录中的index.php文件出问题导致的,出问题的index.php文件打开后会出现一堆乱码。

如果你的网站也是这样的问题,那么处理方法很简单,只需要重装一下wordpress 6.0.1就可以了。一般wordpress外贸建站用户都可以直接在wordpress后台重装,如上图所示,点【更新】,然后选重装6.0.1就可以了,如果重装成功,那么/wp-admin地址不能打开的问题就可以解决。(建议:问题修复之后,大家可以点一下上面的第一个“切换到仅自动安装维护和安全版本更新”)

留下评论

您的邮箱地址不会被公开。 必填项已用 * 标注

Commonly asked questions and answers

Phone:
+1 (555) 000-0000
Email:
info@mysite.com
What does your web design and development process include?
Egestas nullam vehicula, at litora pharetra lacinia. Integer suspendisse condimentum, urna etiam, risus sollicitudin primis varius erat. Donec senectus massa, hendrerit vulputate convallis felis.

Aenean fames risus sodales, viverra accumsan suspendisse, eleifend nunc pharetra hendrerit hac class. Viverra sit vitae dictumst, massa consequat hac, nullam tristique vehicula metus eleifend curabitur. Tellus nostra commodo, et inceptos facilisis neque.

Augue vestibulum netus, neque ante a turpis molestie. Phasellus maecenas, hendrerit varius tristique non. Egestas rutrum ornare augue, suspendisse vehicula pellentesque, dictum ad cubilia nisi lectus duis sodales at. Pretium arcu dictumst, inceptos hendrerit, ad sociosqu pellentesque sollicitudin curabitur curae.

Newsletter subscribe!

Enter your email to unlock an exclusive 10% discount on professional website development tailored to your business needs.

Have more questions?

Let’s schedule a short call to discuss how we can work together and contribute to the success of your project or idea.