Question
How do you find what's causing 403 errors on a website?
Answer
A "403 Forbidden" error is a response code from Apache when the requested action cannot be completed for security reasons.
There are a few common things that could be happening to cause this, such as:
- .htaccess file rules
- Inadequate permissions on a file
- Incorrect ownership of a file
The easiest way to determine the cause of a 403 error is to use the 'tail' command to tail the Apache error log while replicating the 403 error in your browser by refreshing the page you see the 403 error on:
# tail -fn0 /etc/apache2/logs/error_log
[Wed May 20 00:45:52.779769 2020] [core:crit] [pid 4292] (13)Permission denied: [client IP:57708] AH00529: /home/user/public_html/.htaccess pcfg_openfile: unable to check htaccess file, ensure it is readable and that '/home/error/public_html/' is executable
The above error indicates an issue accessing the .htaccess file, and the permissions on the reported file should be corrected as required.
Additional Resources
How to test if an .htaccess file is causing a problem
Comments
0 comments
Article is closed for comments.