From e4efc3f4f4f3f66842d6208c65b79f1eacad961e Mon Sep 17 00:00:00 2001 From: Kimberly Date: Thu, 18 Aug 2016 04:41:12 -0400 Subject: [PATCH] Update PgCacheAdminEnvironment.php Apache 2.4+ has deprecated the "Allow, Deny, and Order" directives in .htaccess, in favor of "Require". Such servers would now be required to load the "mod_access_compat" module to regain "Allow, Deny, and Order" (unlike pre-2.4). For w3tc's "Enable Compatibility Mode" to function correctly on servers that have upgraded i've put in the appropriate module condition check. --- lib/W3/PgCacheAdminEnvironment.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/W3/PgCacheAdminEnvironment.php b/lib/W3/PgCacheAdminEnvironment.php index ac39df7..008108e 100644 --- a/lib/W3/PgCacheAdminEnvironment.php +++ b/lib/W3/PgCacheAdminEnvironment.php @@ -1141,7 +1141,12 @@ private function rules_cache_generate_apache($config) { // allow to read files by apache if they are blocked at some level above $rules .= "\n"; - $rules .= " Allow from all\n"; + $rules .= " \n"; + $rules .= " Require all granted\n"; + $rules .= " \n"; + $rules .= " \n"; + $rules .= " Allow from all\n"; + $rules .= " \n"; $rules .= "\n"; if (!$etag) {