From a3dd461422e208b4a3f57e1b62d8a77e81805434 Mon Sep 17 00:00:00 2001 From: Eddie Kohler Date: Wed, 30 Oct 2013 04:19:49 -0400 Subject: [PATCH] Use IfModule in .htaccess files for Apache 2.4. --- Code/.htaccess | 5 +++++ README.md | 9 +++++++++ conf/.htaccess | 5 +++++ lib/.htaccess | 5 +++++ lib/documenthelper.php | 2 +- src/.htaccess | 5 +++++ 6 files changed, 30 insertions(+), 1 deletion(-) diff --git a/Code/.htaccess b/Code/.htaccess index 93169e4eb4..c48e2ba054 100755 --- a/Code/.htaccess +++ b/Code/.htaccess @@ -1,2 +1,7 @@ + +Require all denied + + Order deny,allow Deny from all + diff --git a/README.md b/README.md index 569a2dba92..6abf61771b 100644 --- a/README.md +++ b/README.md @@ -94,6 +94,15 @@ directory. For example, this section of httpd.conf makes the Alias /testconf /home/kohler/hotcrp + Apache 2.4 or later requires this instead. + + + Options Indexes Includes FollowSymLinks + AllowOverride all + Require all granted + + Alias /testconf /home/kohler/hotcrp + Note that the first argument to Alias should NOT end in a slash. The "AllowOverride all" directive is required. diff --git a/conf/.htaccess b/conf/.htaccess index 93169e4eb4..c48e2ba054 100644 --- a/conf/.htaccess +++ b/conf/.htaccess @@ -1,2 +1,7 @@ + +Require all denied + + Order deny,allow Deny from all + diff --git a/lib/.htaccess b/lib/.htaccess index 93169e4eb4..c48e2ba054 100755 --- a/lib/.htaccess +++ b/lib/.htaccess @@ -1,2 +1,7 @@ + +Require all denied + + Order deny,allow Deny from all + diff --git a/lib/documenthelper.php b/lib/documenthelper.php index ef03752ded..4f9a1ad5b4 100644 --- a/lib/documenthelper.php +++ b/lib/documenthelper.php @@ -251,7 +251,7 @@ private static function _store_filestore($fsinfo, $doc) { // filestore directory $htaccess = "$fdir/.htaccess"; if (!is_file($htaccess) - && file_put_contents($htaccess, "Order deny,allow\nDeny from all\nphp_flag magic_quotes_gpc off\n") === false) { + && file_put_contents($htaccess, "\nRequire all denied\n\n\nOrder deny,allow\nDeny from all\n\n") === false) { @unlink("$fdir/.htaccess"); return false; } diff --git a/src/.htaccess b/src/.htaccess index 93169e4eb4..c48e2ba054 100644 --- a/src/.htaccess +++ b/src/.htaccess @@ -1,2 +1,7 @@ + +Require all denied + + Order deny,allow Deny from all +