wordpress403_如何修复WordPress中的403禁止错误

2022-06-22 00:00:00 wordpress403

《wordpress403_如何修复WordPress中的403禁止错误》

wordpress403

Are you dealing with the 403 Forbidden error on your WordPress site? It is one of the most dreadful errors that a WordPress beginner can come across. In this article, we will show you how to easily fix the 403 forbidden error in WordPress.

您是否正在处理WordPress网站上的403 Forbidden错误? 这是WordPress初学者可能遇到的最可怕的错误之一。 在本文中,我们将向您展示如何轻松修复WordPress中的403禁止错误。

《wordpress403_如何修复WordPress中的403禁止错误》

什么是WordPress中的403禁止访问拒绝错误? (What is a 403 Forbidden – Access Denied Error in WordPress?)

WordPress shows codes and messages when an error occurs on your website. See our list of most common WordPress errors and how to fix them.

当您的网站上发生错误时,WordPress会显示代码和消息。 请参阅我们最常见的WordPress错误列表以及如何修复它们 。

《wordpress403_如何修复WordPress中的403禁止错误》

403 Forbidden error code is shown when your server permissions don’t allow access to a specific page.

当您的服务器权限不允许访问特定页面时,将显示403禁止错误代码。

This is why the error is usually accompanied by the text:

这就是错误通常伴随文本的原因:

403 Forbidden – You don’t have permission to access ‘/’ on this server.

403禁止访问–您无权访问此服务器上的“ /”。

Additionally, a 403 Forbidden error was encountered while trying to use an ErrorDocument to handle the request.

此外,尝试使用ErrorDocument处理请求时遇到403 Forbidden错误。

There are different scenarios when you can see this error. For example:

在不同的情况下,您可以看到此错误。 例如:

  • wp-admin or wp-admin或WordPress login page.WordPress登录页面上拒绝访问。
  • WordPress install.WordPress安装期间。
  • 403 Forbidden error when visiting any page on your WordPress site.

    当访问WordPress网站上的任何页面时,出现403禁止错误。

  • ‘Access Denied’ instead of full 403 Forbidden status.“访问被拒绝”,而不是完整的403禁止状态。
  • You may also see ‘Access to yourdomain.com was denied. You don’t have authorization to view this page.’

    您可能还会看到“拒绝访问yourdomain.com。 您无权查看此页面。”

Now that you know about the different types of 403 errors, let’s talk about what causes this error.

现在您已经了解了403错误的不同类型,下面我们来讨论导致此错误的原因。

是什么导致WordPress中的403禁止错误? (What Causes 403 Forbidden Error in WordPress?)

The most common cause for the 403 Forbidden error in WordPress is due to poorly configured security plugins. Many WordPress security plugins can block an IP address (or a whole range of IP addresses) if they believe them to be malicious.

WordPress中出现403 Forbidden错误的最常见原因是由于安全插件配置不良。 如果许多WordPress安全插件认为它们是恶意的,则可以阻止其IP地址(或整个IP地址范围)。

This is why we use Sucuri to improve security of all our WordPress sites.

这就是为什么我们使用Sucuri来提高我们所有WordPress网站的安全性的原因。

Another possible cause could be a corrupt .htaccess file or incorrect file permissions on your server.

另一个可能的原因可能是.htaccess文件损坏或服务器上的文件权限不正确 。

Your WordPress hosting company can sometimes make accidental changes to their server settings. This may result in 403 Forbidden error on your site.

您的WordPress托管公司有时可能会意外更改其服务器设置。 这可能会在您的网站上导致403禁止错误。

Having said that, let’s take a look at how to solve 403 forbidden error in WordPress.

话虽如此,让我们看一下如何解决WordPress中的403禁止错误。

影片教学 (Video Tutorial)

演示地址

If you don’t like the video or need more instructions, then continue reading.

如果您不喜欢该视频或需要更多说明,请继续阅读。

在WordPress中修复403禁止的错误 (Fixing 403 Forbidden Error in WordPress)

Before you do anything, we recommend that you create a complete WordPress backup of your website. Here is our guide on how to manually create a WordPress backup.

在执行任何操作之前,我们建议您创建网站的完整WordPress备份。 这是我们有关如何手动创建WordPress备份的指南 。

If you were already using an automatic WordPress backup plugin, then make sure that you have access to a latest backup before moving forward.

如果您已经在使用WordPress自动备份插件 ,请在继续操作之前确保您可以访问最新的备份。

1.修复WordPress插件导致的403禁止错误 (1. Fixing 403 Forbidden Error Caused by a WordPress Plugin)

First thing you need to do is to temporarily deactivate all WordPress plugins. This includes any security plugins that you may have installed on your site.

您需要做的第一件事是暂时停用所有WordPress插件 。 这包括您可能已在网站上安装的所有安全性插件。

If this resolves your problem, then this means one of the plugins on your website was causing this error.

如果这可以解决您的问题,则表明您网站上的一个插件引起了此错误。

You can figure out which plugin was causing the error by activating all your plugins one at a time until you are able to reproduce the 403 forbidden error.

您可以一次激活所有插件,直到能够重现403禁止的错误,然后找出导致该错误的插件。

2.修复.htaccess文件损坏导致的403禁止错误 (2. Fix 403 Forbidden Error Caused by Corrupt .htaccess File)

Often the 403 error is caused by a corrupt .htaccess file in your WordPress site. Repairing this file is quite easy.

403错误通常是由WordPress网站中的.htaccess文件损坏引起的。 修复此文件非常容易。

First you need to connect to your website using a FTP client or file manager in cPanel.

首先,您需要使用cPanel中的FTP客户端或文件管理器连接到您的网站。

Next, locate the .htaccess file in the root folder of your WordPress site. See this guide if you can’t find .htaccess file in Your WordPress folder.

接下来,在WordPress网站的根文件夹中找到.htaccess文件。 如果您在WordPress文件夹中找不到.htaccess文件,请参阅本指南。

You need to download the .htaccess file to your computer so that you have a fresh backup of it. After that, you need to delete the file from your server.

您需要将.htaccess文件下载到计算机上,以便对其进行全新备份。 之后,您需要从服务器中删除文件。

《wordpress403_如何修复WordPress中的403禁止错误》

Try accessing your website. If 403 forbidden error is resolved, then this means that your .htaccess file was corrupt.

尝试访问您的网站。 如果403禁止错误得到解决,则意味着您的.htaccess文件已损坏。

You can generate a fresh .htaccess file by logging into your WordPress admin area and going to Settings » Permalinks page.

您可以通过登录WordPress管理区域并转到“设置”»“永久链接”页面来生成新的.htaccess文件。

《wordpress403_如何修复WordPress中的403禁止错误》

Simply click on the Save Changes button at the bottom of the page and WordPress will generate a fresh .htaccess file.

只需单击页面底部的“ 保存更改”按钮,WordPress就会生成一个新的.htaccess文件。

3.修复WordPress中文件权限引起的403禁止错误 (3. Fix 403 Forbidden Error Caused by File Permissions in WordPress)

All files stored on your website have file permissions. These file permissions control who can access files and folders on your website.

网站上存储的所有文件均具有文件许可权。 这些文件权限控制谁可以访问您网站上的文件和文件夹。

Incorrect file permissions can cause 403 forbidden error. It makes your web server thinks that you do not have permission to access those files.

不正确的文件权限可能导致403禁止错误。 它使您的Web服务器认为您没有访问这些文件的权限。

If the above two solutions do not solve the 403 forbidden error on your site, then incorrect file permissions can be the most likely cause.

如果以上两种解决方案都不能解决您网站上的403禁止错误,则最可能的原因是文件权限错误。

You can ask your WordPress hosting provider to check your website for correct file permissions. Some hosts are very supportive, they wouldn’t mind and will probably fix that for you.

您可以要求WordPress托管提供商检查您的网站是否具有正确的文件权限。 一些主持人非常支持,他们不介意并且可能会为您解决该问题。

Changing file permissions yourself can have serious consequences. If you do not feel confident doing it yourself, then ask a friend for help or hire a professional.

自行更改文件权限可能会导致严重后果。 如果您对自己做的事情没有信心,请向朋友寻求帮助或聘请专业人员。

However, if you want to do it yourself, then here is how you would check your file permissions.

但是,如果您想自己执行此操作,则可以按以下方法检查文件权限。

Simply connect to your WordPress site using an FTP client. Navigate to the root folder containing all your WordPress files.

只需使用FTP客户端连接到您的WordPress网站即可。 导航到包含所有WordPress文件的根文件夹。

《wordpress403_如何修复WordPress中的403禁止错误》

Click to select a folder, right click and then select File Permissions from the menu.

单击以选择一个文件夹,右键单击,然后从菜单中选择“文件权限”。

Your FTP client will show you a file permissions dialog box like this:

您的FTP客户端会显示一个文件权限对话框,如下所示:

《wordpress403_如何修复WordPress中的403禁止错误》

All folders on your WordPress site should have a file permission of 744 or 755.

WordPress网站上的所有文件夹应具有744或755的文件许可权。

All files on your WordPress site should have a file permission of 644 or 640.

WordPress网站上的所有文件都应具有644或640的文件许可权。

You can set the file permission to the root folder to 744 or 755. Check the box next to ‘Recurse into subdirectories’ and then check the option that says ‘apply to directories only’.

您可以将根文件夹的文件权限设置为744或755。选中“递归到子目录”旁边的框,然后选中“仅应用于目录”选项。

Click on the OK button. Your FTP client will now start setting permissions to all subdirectories in that folder.

单击确定按钮。 您的FTP客户端现在将开始为该文件夹中的所有子目录设置权限。

Once it is done, you need to repeat the process for all the files. This time you will use file permission of 644 or 640 and don’t forget to select ‘Recurse into subdirectories’ and ‘apply to files only’. options.

完成后,您需要对所有文件重复该过程。 这次,您将使用文件权限644或640,并且不要忘记选择“递归到子目录”“仅应用于文件”。 选项。

Click on the OK button and your FTP client will start setting file permissions for all the selected files.

单击确定按钮,您的FTP客户端将开始为所有选定文件设置文件权限。

Try accessing your website now, and 403 forbidden error should be gone now.

现在尝试访问您的网站,并且403禁止错误现在应该消失了。

We hope this article helped you fix the 403 forbidden error in WordPress. You may also want to see our expert tips and hacks to protect your WordPress admin area.

我们希望本文能帮助您解决WordPress中的403禁止错误。 您可能还希望查看我们的专家提示和技巧,以保护WordPress管理区域 。

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

如果您喜欢这篇文章,请订阅我们的YouTube频道 WordPress视频教程。 您也可以在Twitter和Facebook上找到我们。

翻译自: https://www.wpbeginner.com/wp-tutorials/how-to-fix-the-403-forbidden-error-in-wordpress/

wordpress403

    原文作者:cumohuo9136
    原文地址: https://blog.csdn.net/cumohuo9136/article/details/108607423
    本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。

相关文章