From 6e2d09ae3bc63e6e601fc181d4db03954fb23d63 Mon Sep 17 00:00:00 2001
From: Werner Flamme/WKDV <werner.flamme@ufz.de>
Date: Mon, 7 Dec 2015 15:20:20 +0100
Subject: [PATCH] Adapt .htaccess files for Apache 2.4

---
 .htaccess.dist     | 9 +++++++--
 bin/.htaccess      | 9 +++++++--
 conf/.htaccess     | 9 +++++++--
 data/.htaccess     | 9 +++++++--
 inc/.htaccess      | 9 +++++++--
 inc/lang/.htaccess | 9 +++++++--
 6 files changed, 42 insertions(+), 12 deletions(-)

diff --git a/.htaccess.dist b/.htaccess.dist
index 5724a6e04..ec28dff85 100644
--- a/.htaccess.dist
+++ b/.htaccess.dist
@@ -6,8 +6,13 @@
 
 ## make sure nobody gets the htaccess, README, COPYING or VERSION files
 <Files ~ "^([\._]ht|README$|VERSION$|COPYING$)">
-    Order allow,deny
-    Deny from all
+    <IfModule mod_authz_host>
+        Require all denied
+    </IfModule>
+    <IfModule !mod_authz_host>
+        Order allow,deny
+        Deny from all
+    </IfModule>
 </Files>
 
 ## Uncomment these rules if you want to have nice URLs using
diff --git a/bin/.htaccess b/bin/.htaccess
index 281d5c33d..5f279f180 100644
--- a/bin/.htaccess
+++ b/bin/.htaccess
@@ -1,2 +1,7 @@
-order allow,deny
-deny from all
+<IfModule mod_authz_host>
+    Require all denied
+</IfModule>
+<IfModule !mod_authz_host>
+    Order allow,deny
+    Deny from all
+</IfModule>
diff --git a/conf/.htaccess b/conf/.htaccess
index bcc3ea0bd..b3ffca597 100644
--- a/conf/.htaccess
+++ b/conf/.htaccess
@@ -1,3 +1,8 @@
 ## no access to the conf directory
-order allow,deny
-deny from all
+<IfModule mod_authz_host>
+    Require all denied
+</IfModule>
+<IfModule !mod_authz_host>
+    Order allow,deny
+    Deny from all
+</IfModule>
diff --git a/data/.htaccess b/data/.htaccess
index 281d5c33d..5f279f180 100644
--- a/data/.htaccess
+++ b/data/.htaccess
@@ -1,2 +1,7 @@
-order allow,deny
-deny from all
+<IfModule mod_authz_host>
+    Require all denied
+</IfModule>
+<IfModule !mod_authz_host>
+    Order allow,deny
+    Deny from all
+</IfModule>
diff --git a/inc/.htaccess b/inc/.htaccess
index 2d9c357ff..2b34c725f 100644
--- a/inc/.htaccess
+++ b/inc/.htaccess
@@ -1,3 +1,8 @@
 ## no access to the inc directory
-order allow,deny
-deny from all
+<IfModule mod_authz_host>
+    Require all denied
+</IfModule>
+<IfModule !mod_authz_host>
+    Order allow,deny
+    Deny from all
+</IfModule>
diff --git a/inc/lang/.htaccess b/inc/lang/.htaccess
index 2d69be754..2aaae02fd 100644
--- a/inc/lang/.htaccess
+++ b/inc/lang/.htaccess
@@ -1,3 +1,8 @@
 ## no access to the lang directory
-order allow,deny
-deny from all
+<IfModule mod_authz_host>
+    Require all denied
+</IfModule>
+<IfModule !mod_authz_host>
+    Order allow,deny
+    Deny from all
+</IfModule>
-- 
GitLab