Symptoms
When attempting to load a site, you encounter a 403 error, and /var/log/apache2/error_log
contains an entry similar to the following.
2024-03-28 13:44:26.929433 [INFO] [1225923] [T0] [203.0.113.2:52317-H3:CF429B-4#APVH_domain.tld:443] [ACL] Access to context [/] is denied!
Description
The 403 error is caused by an incorrectly constructed Deny
rule in the site's .htaccess
file. Deny
rules are frequently found in FilesMatch
directives.
<FilesMatch "\.(ico|pdf|flv|swf|js|mjs|css|gif|png|jpg|jpeg|txt|woff2|woff)$">
Order Allow,Deny
Deny from all
</FilesMatch>
Workaround
- Access the server's command line via SSH or "Terminal" in WHM or cPanel.
- Open the site's
.htaccess
file in your preferred text editor. - Make any needed changes to the rules associated with the
Deny
rule.
Please note that when usingOrder Allow,Deny
, theDeny from all
rule will deny all traffic regardless ofAllow
rules. - Save the changes and exit the text editor.
Comments
0 comments
Article is closed for comments.