Apache 2.4 throws errors with .htaccess hardening in the wp-content folder
-
Not sure if you have this on the “future fixes” list or not… but Apache 2.4 drops the old Order/allow/deny style of authentication and the hardening option for the wp-content folder that blocks the *.php files causes the server to throw errors if they don’t have the mod_access_compat module installed.
https://httpd.apache.org/docs/2.4/mod/mod_access_compat.htmlSince the mod_access_compat is a stop-gap which will only exist for a limited timeline of apache releases, it’s probably best to give a couple of options in the hardening section (or just give one that detects a version of apache and writes the proper code for that version).
The 2.4 version would read:
<Files "*.php"> Require all denied </Files>
Hope this helps!
Also, if you have a plugin or theme that has PHP files called directly and the hardening .htaccess file this option creates throws more errors when they can’t be accessed such as this:
AH01797: client denied by server configuration: /home/###/public_html/wp-content/plugins/easy-responsive-tabs/assets/js/ert_js.php
I found you can tweak the .htaccess to allow direct access to those files such as this:
<Files "*.php"> Require all denied </Files> <Files "ert_js.php"> Require all granted </Files>
- The topic ‘Apache 2.4 throws errors with .htaccess hardening in the wp-content folder’ is closed to new replies.