HTTP status code 403 indicates that the server understood the client’s request but refuses to fulfill it. This is typically due to restrictions on the server, such as permission settings, security policies, or legal reasons.
The 403 error differs from the 404 error; a 404 “Not Found” means the server could not find the requested resource, whereas a 403 indicates that the server found the resource but does not allow access.
Common Causes of 403 Status Code
- Insufficient Permissions: The user lacks the necessary permissions to access the specific resource.
- Authentication Issues: The user has not been authenticated, or the authentication information is incorrect.
- IP Address Blocked: The user’s IP address is banned from accessing the server.
- Account Suspended: The user’s account is prohibited from accessing the website.
- Legal Restrictions: Access to the resource is restricted by law or policy.
When returning a 403 status code, the server may include a WWW-Authenticate
field in the response header, indicating how the client should authenticate. If the issue is authentication-related, the server may require the user to provide valid authentication credentials.
For example, the server might send the following response:
HTTP/1.1 403 Forbidden
Content-Type: text/html
WWW-Authenticate: Basic realm="example"
Content-Length: 234
<html>
<head><title>403 Forbidden</title></head>
<body>
<h1>Forbidden</h1>
<p>You do not have the necessary credentials to access this resource.</p>
</body>
</html>
In this example, the status code 403 indicates that access is denied, and the WWW-Authenticate header specifies that Basic authentication is required, providing a protected realm.
When the client receives a 403 error, it should check whether it has permission to access the resource and ensure that correct authentication information has been provided. If the issue persists, it may be necessary to contact the website administrator or service provider for further assistance.
Related 4xx error code
- 400 Bad Request
- 401 Unauthorized
- 402 Payment Required
- 404 Not Found
- 405 Method Not Allowed
- 406 Not Acceptable
- 407 Proxy Authentication Required
- 408 Request Timeout
- 409 Conflict
- 410 Gone
- 411 Length Required
- 412 Precondition Failed
- 413 Payload Too Large
- 414 URI Too Long
- 415 Unsupported Media Type
- 416 Range Not Satisfiable
- 417 Expectation Failed
- 418 I’m a teapot
- 421 Misdirected Request
- 422 Unprocessable Entity (WebDAV)
- 423 Locked (WebDAV)
- 424 Failed Dependency (WebDAV)
- 425 Too Early
- 426 Upgrade Required
- 428 Precondition Required
- 429 Too Many Requests
- 431 Request Header Fields Too Large
- 451 Unavailable For Legal Reasons
- 499 Client Closed Request