![http错误403 禁止](https://i-blog.csdnimg.cn/blog_migrate/80b293c621d3f5187a24cf58e0d24e36.png)
http错误403 禁止
![error-403-header](https://i-blog.csdnimg.cn/blog_migrate/fcf5cb4c0c3993f0aaeb47ecee8c9ca9.png)
A 403 Forbidden Error occurs when a web server forbids you from accessing the page you’re trying to open in your browser. Most of the time, there’s not much you can do. But sometimes, the problem might be on your end. Here are some things you can try.
当Web服务器禁止您访问要在浏览器中打开的页面时,将发生403禁止错误。 大多数时候,您无能为力。 但是有时候,问题可能出在您身上。 您可以尝试以下方法。
什么是403禁止错误? (What is a 403 Forbidden Error?)
The 403 Forbidden Error happens when the web page (or other resource) that you’re trying to open in your web browser is a resource that you’re not allowed to access. It’s called a 403 error because that’s the HTTP status code that the web server uses to describe that kind of error. You usually get this error for one of two reasons. The first is that the owners of the web server have properly set up access permissions, and that you’re really not allowed access to the resource. The second reason is that the owners of the web server have improperly set up permissions and you’re getting denied access when you really shouldn’t be.
当您尝试在Web浏览器中打开的网页(或其他资源)是您不允许访问的资源时,就会发生403禁止错误。 之所以称为403错误,是因为这是Web服务器用来描述此类错误的HTTP状态代码。 通常,您会由于以下两个原因之一而收到此错误。 首先是Web服务器的所有者已经正确设置了访问权限,并且实际上不允许您访问该资源。 第二个原因是Web服务器的所有者未正确设置权限,而您本来应该拒绝访问权限。
Just like with 404 errors and 502 errors, website designers can customize how a 403 error looks. So, you might see different looking 403 pages on different websites. Websites might also use slightly different names for this error. For example, you might see things like:
就像404错误和502错误一样 ,网站设计者可以自定义403错误的外观。 因此,您可能会在不同的网站上看到外观不同的403页。 网站可能还会对此错误使用稍微不同的名称。 例如,您可能会看到以下内容:
- 403 Forbidden 403禁止
- HTTP 403 HTTP 403
- Forbidden 禁止的
- HTTP Error 403 – Forbidden HTTP错误403 –禁止
- HTTP Error 403.14 – Forbidden HTTP错误403.14 –禁止
- Error 403 错误403
- Forbidden: You don’t have permission to access [directory] on this server 禁止访问:您无权访问此服务器上的[目录]
- Error 403 – Forbidden 错误403 –禁止
The vast majority of the time, there’s not much you can do to fix things on your end. Either you’re really not allowed to access the resource, or there’s an error on the server side of things. Sometimes, it’s a temporary error; sometimes it isn’t. Still, there are some things you can try.
在绝大多数情况下,您无法做很多事情来解决问题。 确实不允许您访问资源,或者服务器端发生错误。 有时,这是暂时的错误; 有时候不是。 不过,您可以尝试一些方法。
刷新页面 (Refresh the Page)
Refreshing the page is always worth a shot. Many times the 403 error is temporary, and a simple refresh might do the trick. Most browsers use the F5 key to refresh, and also provide a Refresh button somewhere on the address bar. It doesn’t fix the problem very often, but it takes just a second to try.
刷新页面始终值得一试。 很多时候403错误是暂时的,只需刷新即可解决问题。 大多数浏览器使用F5键刷新,并在地址栏上的某个位置提供“刷新”按钮。 它不会经常解决问题,但是只需一秒钟即可尝试。
![](assets%5Crefresh-the-page.png)
![refresh-the-page](https://i-blog.csdnimg.cn/blog_migrate/193290ed28181c275399ca5be64dfb92.png)
仔细检查地址 (Double Check the Address)
The most common reason for a 403 error is a mistyped URL. Make sure that the address you are trying to access is for a web page or file, not a directory. A regular URL would end in .com, .php, .org, .html, or just have an extension, while a directory URL would usually end with a “/”.
403错误的最常见原因是网址输入错误。 确保您尝试访问的地址用于网页或文件,而不是目录。 常规URL以.com,.php,.org,.html结尾或仅具有扩展名,而目录URL通常以“ /”结尾。
![check-the-url](https://i-blog.csdnimg.cn/blog_migrate/317fbea4017e93cb0474d58de564b781.png)
Most servers are configured to disallow directory browsing for security reasons. When they’re properly configured, you’re redirected to another page. When they’re not, you might see a 403 error.
出于安全原因,大多数服务器都配置为禁止目录浏览。 正确配置它们后,您将被重定向到另一个页面。 如果不是,您可能会看到403错误。
清除浏览器Cookie和缓存 (Clear Your Browser Cookies and Cache)
It’s also possible the page with the error has been cached in your browser, but the actual link was changed on the website. To test out this possibility, you’ll have to clear your browser cache and cookies. Clearing the cache won’t affect your browsing experience much, but some websites may a take a couple of extra seconds to load as they re-download all the previously cached data. Clearing cookies means you’ll have to sign in again to most websites.
错误页面也可能已缓存在您的浏览器中,但实际链接已在网站上更改。 为了测试这种可能性,您必须清除浏览器缓存和cookie。 清除缓存不会对您的浏览体验造成太大影响,但是某些网站在重新下载所有先前缓存的数据时可能会花费额外的几秒钟时间。 清除Cookie意味着您将不得不再次登录大多数网站。
![](https://i-blog.csdnimg.cn/blog_migrate/99a64f7c092ed69939ae429900c4212e.png)
To clear the cache in your browser, you can follow this extensive guide which will teach you how to clear your cache on all the popular desktop and mobile browsers.
要清除浏览器中的缓存,您可以按照这份详尽的指南进行操作 , 该指南将教您如何清除所有流行的台式机和移动浏览器上的缓存。
检查您是否具有访问URL的权限 (Check if You Have Permission to Access the URL)
If you’re trying to access a website which requires you to log in before you can see the content, then that might be causing the issue. Typically, servers are configured to show you an error letting you know you must be logged in to access the content.
如果您尝试访问的网站要求您先登录才能看到内容,则可能是造成此问题的原因。 通常,服务器配置为向您显示错误,使您知道必须登录才能访问内容。
![login-to-website](https://i-blog.csdnimg.cn/blog_migrate/5b3d732fe33c68d9bb3e57049b65abf8.png)
But some improperly configured servers might throw a 403 error instead. Try to log into the website (if possible) and see if the error goes away.
但是某些配置不当的服务器可能会抛出403错误。 尝试登录网站(如果可能),然后查看错误是否消失。
稍后再试 (Try Again Later)
If none of the simple solutions we’ve talked about so far work, you can always wait a while and come back later. Since most of the time, 403 Errors are caused by issues with the website in question, it’s likely someone is already working on the problem.
如果到目前为止我们还没有讨论过任何简单的解决方案,但是您总是可以稍等片刻,然后再回来。 在大多数情况下,“ 403错误”是由相关网站的问题引起的,很可能有人已经在解决该问题。
联系网站 (Contact the Website)
Another option is to contact the website owner directly. Look up their contact information on the website and contact them about the page in question. If there is no contact form, you can try and reach the website on their social media.
另一种选择是直接与网站所有者联系。 在网站上查找他们的联系信息,并就有关页面与他们联系。 如果没有联系表,您可以尝试在其社交媒体上访问该网站。
联系您的ISP (Contact your ISP)
If you can confirm that the website in question is working for others but not for you, then it’s possible that the public IP address your ISP provided you (or your whole ISP) has been blocked for some reason. You can try contacting them and letting them know about the problem. It’s not a very likely solution, but they might be able to help.
如果您可以确认所讨论的网站正在为其他网站而不是为您服务,那么您的ISP提供给您(或您的整个ISP)的公共IP地址可能由于某种原因被阻止了。 您可以尝试与他们联系,并让他们知道问题所在。 这不是一个很可能的解决方案,但他们可能会提供帮助。
翻译自: https://www.howtogeek.com/357785/what-is-a-403-forbidden-error-and-how-can-i-fix-it/
http错误403 禁止