HTTP |
---|
![]() |
Request methods |
Header fields |
Response status codes |
Security access control methods |
Security vulnerabilities |
HTTP 403 is an HTTP status code meaning access to the requested resource is forbidden. The server understood the request, but will not fulfill it, if it was correct.
HTTP 403 provides a distinct error case from HTTP 401; while HTTP 401 is returned when the client has not authenticated, and implies that a successful response may be returned following valid authentication, HTTP 403 is returned when the client is not permitted access to the resource despite providing authentication such as insufficient permissions of the authenticated account.[a]
Error 403: "The server understood the request, but is refusing to authorize it."[1]: §15.5.4
Error 401: "The 401 (Unauthorized) status code indicates that the request has not been applied because it lacks valid authentication credentials for the target resource."[1]: §15.5.2
TheApache web server returns 403 Forbidden in response to requests forURL[2] paths that corresponded tofile systemdirectories when directory listings have been disabled in the server and there is noDirectory Index directive to specify an existing file to be returned to the browser. Some administrators configure theMod proxy extension to Apache to block such requests and this will also return 403 Forbidden. MicrosoftIIS responds in the same way when directory listings are denied in that server. InWebDAV, the 403 Forbidden response will be returned by the server if the client issued a PROPFIND request but did not also issue the required Depth header or issued a Depth header of infinity.[2]
A 403 status code can occur for the following reasons:[3]
Client request:[4]
GET/securedpage.phpHTTP/1.1Host:www.example.org
Server response:[4]
HTTP/1.1403ForbiddenContent-Type:text/html<html><head><title>403 Forbidden</title></head><body><h1>Forbidden</h1><p>You don't have permission to access /securedpage.php on this server.</p></body></html>