错误403禁止解释-如何修复此HTTP错误代码?

So you have encountered a 403 Forbidden error and you are wondering what it means.

因此,您遇到了403禁止错误,您想知道这是什么意思。

This error is an HTTP status code which means that you are forbidden from accessing the page or resource that you are trying to reach. Unless you are the person who created the website, there is often nothing you can do. However, there are a few things that might help.

此错误是HTTP状态代码,表示禁止您访问您尝试访问的页面或资源。 除非您是创建网站的人,否则您通常无能为力。 但是,有些事情可能会有所帮助。

It is possible the creator of the website set up the permissions correctly and is intentionally forbidding you from accessing the page. But this error could also indicate that the website was set up incorrectly.

网站的创建者可能会正确设置权限,并有意禁止您访问该页面。 但是此错误也可能表明该网站设置不正确。

Here are some things you can try to fix the 403 Forbidden error.

您可以尝试以下操作来修复403禁止错误。

🔄验证并刷新 (🔄 Verify and refresh)

First verify that the URL is correct and refresh the page. This is the first thing you should do when you encounter any error on a website.

首先,验证URL是否正确,然后刷新页面。 这是您在网站上遇到任何错误时应该做的第一件事。

Most web servers are set up to return a 403 Forbidden error if someone tries to access a directory on the server instead of a file (like an HTML file). So you may have typed in the URL incorrectly and are trying to access a directory.

如果有人尝试访问服务器上的目录而不是文件(例如HTML文件),则大多数Web服务器都设置为返回403 Forbidden错误。 因此,您可能输入了错误的URL,并试图访问目录。

🚫清除浏览器缓存 (🚫 Clear browser cache)

A cached version of the page could be causing the issue. Here are shortcut keys that will clear the browser cache on most browsers:

页面的缓存版本可能导致此问题。 以下是快捷键,这些快捷键将清除大多数浏览器上的浏览器缓存:

  • Windows: CTRL + F5

    Windows: CTRL + F5

  • Mac/Apple: Apple + Shift + R or Command + Shift + R

    Mac / Apple: Apple + Shift + R or Command + Shift + R

⌨️登录 (⌨️ Log in)

It is possible that the page you are trying to access requires you to log in. If so, make sure to log in to get additional access.

您尝试访问的页面可能需要您登录。如果这样,请确保登录以获取其他访问权限。

🍪清除Cookie (🍪 Clear cookies )

Clearing your browser's cookies can sometimes help. This is especially true if the site usually requires a log in, and if logging out and in does not solve the problem.

清除浏览器的Cookie有时会有所帮助。 如果站点通常需要登录,并且注销和登录不能解决问题,则尤其如此。

📢联系网站 (📢 Contact the website)

It is possible the website has been set up incorrectly and the creator of the website is not aware. Other people could be getting this same error. Try to find the contact information for the website and let them know about the problem. It could be a simple fix on their end.

网站可能设置不正确,并且网站的创建者不知道。 其他人可能会遇到同样的错误。 尝试查找网站的联系信息,并让他们知道问题所在。 这可能是解决它们的一个简单方法。

later️稍后再回来 (🛏️ Come back later)

Often 403 Forbidden errors are caused by an issue with the website. It is possible that the website developers are currently working on a fix. If you just try again at a later time, the problem could be fixed.

通常403禁止的错误是由网站问题引起的。 网站开发人员当前正在研究修补程序。 如果您稍后再试,则可能会解决此问题。

仅适用于Web开发人员 (For web developers only)

If you are the creator of the page that is giving a 403 Forbidden error, then it is your job to fix the error on the server. The two most common reasons for the error are no index page and incorrect permissions.

如果您是给出403 Forbidden错误的页面的创建者,那么在服务器上修复该错误是您的工作。 错误的两个最常见原因是没有索引页和不正确的权限。

Make sure the you have a file called index.htm or index.php in the location that is showing the error. For instance, if the URL https://www.freecodecamp.org/forbidden is showing the error, make sure that the directory named forbidden on your server has an index.htm or index.php file located in it.

确保在显示错误的位置中有一个名为index.htm或index.php的文件。 例如,如果URL https://www.freecodecamp.org/forbidden显示错误,请确保服务器上名为forbidden的目录中具有index.htm或index.php文件。

The next thing to look into is the permissions on the files that are creating the error. Here is how the permissions should usually look:

接下来要研究的是创建错误的文件的权限。 权限通常应如下所示:

  • Folders: 755

    文件夹:755
  • Static Content: 644

    静态内容:644
  • Dynamic Content: 700

    动态内容:700

翻译自: https://www.freecodecamp.org/news/error-403-forbidden-explained-how-can-i-fix-this-http-error-code/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值