diff --git a/.htaccess b/.htaccess
index 90b9c16a5a8c0..54e4ed4800a21 100644
--- a/.htaccess
+++ b/.htaccess
@@ -203,76 +203,166 @@
RedirectMatch 403 /\.git
- order allow,deny
- deny from all
+
+ order allow,deny
+ deny from all
+
+ = 2.4>
+ Require all denied
+
- order allow,deny
- deny from all
+
+ order allow,deny
+ deny from all
+
+ = 2.4>
+ Require all denied
+
- order allow,deny
- deny from all
+
+ order allow,deny
+ deny from all
+
+ = 2.4>
+ Require all denied
+
- order allow,deny
- deny from all
+
+ order allow,deny
+ deny from all
+
+ = 2.4>
+ Require all denied
+
- order allow,deny
- deny from all
+
+ order allow,deny
+ deny from all
+
+ = 2.4>
+ Require all denied
+
- order allow,deny
- deny from all
+
+ order allow,deny
+ deny from all
+
+ = 2.4>
+ Require all denied
+
- order allow,deny
- deny from all
+
+ order allow,deny
+ deny from all
+
+ = 2.4>
+ Require all denied
+
- order allow,deny
- deny from all
+
+ order allow,deny
+ deny from all
+
+ = 2.4>
+ Require all denied
+
- order allow,deny
- deny from all
+
+ order allow,deny
+ deny from all
+
+ = 2.4>
+ Require all denied
+
- order allow,deny
- deny from all
+
+ order allow,deny
+ deny from all
+
+ = 2.4>
+ Require all denied
+
- order allow,deny
- deny from all
+
+ order allow,deny
+ deny from all
+
+ = 2.4>
+ Require all denied
+
- order allow,deny
- deny from all
+
+ order allow,deny
+ deny from all
+
+ = 2.4>
+ Require all denied
+
- order allow,deny
- deny from all
+
+ order allow,deny
+ deny from all
+
+ = 2.4>
+ Require all denied
+
- order allow,deny
- deny from all
+
+ order allow,deny
+ deny from all
+
+ = 2.4>
+ Require all denied
+
- order allow,deny
- deny from all
+
+ order allow,deny
+ deny from all
+
+ = 2.4>
+ Require all denied
+
- order allow,deny
- deny from all
+
+ order allow,deny
+ deny from all
+
+ = 2.4>
+ Require all denied
+
- order allow,deny
- deny from all
+
+ order allow,deny
+ deny from all
+
+ = 2.4>
+ Require all denied
+
- order allow,deny
- deny from all
+
+ order allow,deny
+ deny from all
+
+ = 2.4>
+ Require all denied
+
# For 404s and 403s that aren't handled by the application, show plain 404 response
diff --git a/app/.htaccess b/app/.htaccess
index 93169e4eb44ff..707c26b075e16 100644
--- a/app/.htaccess
+++ b/app/.htaccess
@@ -1,2 +1,8 @@
-Order deny,allow
-Deny from all
+
+ order allow,deny
+ deny from all
+
+= 2.4>
+ Require all denied
+
+
diff --git a/bin/.htaccess b/bin/.htaccess
index 896fbc5a341ea..707c26b075e16 100644
--- a/bin/.htaccess
+++ b/bin/.htaccess
@@ -1,2 +1,8 @@
-Order deny,allow
-Deny from all
\ No newline at end of file
+
+ order allow,deny
+ deny from all
+
+= 2.4>
+ Require all denied
+
+
diff --git a/dev/.htaccess b/dev/.htaccess
index 93169e4eb44ff..707c26b075e16 100644
--- a/dev/.htaccess
+++ b/dev/.htaccess
@@ -1,2 +1,8 @@
-Order deny,allow
-Deny from all
+
+ order allow,deny
+ deny from all
+
+= 2.4>
+ Require all denied
+
+
diff --git a/dev/tests/integration/testsuite/Magento/Framework/Composer/_files/testFromClone/.htaccess b/dev/tests/integration/testsuite/Magento/Framework/Composer/_files/testFromClone/.htaccess
index 14249c50bd760..118789f3d955b 100644
--- a/dev/tests/integration/testsuite/Magento/Framework/Composer/_files/testFromClone/.htaccess
+++ b/dev/tests/integration/testsuite/Magento/Framework/Composer/_files/testFromClone/.htaccess
@@ -1 +1,7 @@
-Deny from all
\ No newline at end of file
+
+ deny from all
+
+= 2.4>
+ Require all denied
+
+
diff --git a/dev/tests/integration/testsuite/Magento/Framework/Composer/_files/testFromClone/cache/.htaccess b/dev/tests/integration/testsuite/Magento/Framework/Composer/_files/testFromClone/cache/.htaccess
index 14249c50bd760..118789f3d955b 100644
--- a/dev/tests/integration/testsuite/Magento/Framework/Composer/_files/testFromClone/cache/.htaccess
+++ b/dev/tests/integration/testsuite/Magento/Framework/Composer/_files/testFromClone/cache/.htaccess
@@ -1 +1,7 @@
-Deny from all
\ No newline at end of file
+
+ deny from all
+
+= 2.4>
+ Require all denied
+
+
diff --git a/dev/tests/integration/testsuite/Magento/Framework/Composer/_files/testFromCreateProject/.htaccess b/dev/tests/integration/testsuite/Magento/Framework/Composer/_files/testFromCreateProject/.htaccess
index 14249c50bd760..118789f3d955b 100644
--- a/dev/tests/integration/testsuite/Magento/Framework/Composer/_files/testFromCreateProject/.htaccess
+++ b/dev/tests/integration/testsuite/Magento/Framework/Composer/_files/testFromCreateProject/.htaccess
@@ -1 +1,7 @@
-Deny from all
\ No newline at end of file
+
+ deny from all
+
+= 2.4>
+ Require all denied
+
+
diff --git a/dev/tests/integration/testsuite/Magento/Framework/Composer/_files/testFromCreateProject/cache/.htaccess b/dev/tests/integration/testsuite/Magento/Framework/Composer/_files/testFromCreateProject/cache/.htaccess
index 14249c50bd760..118789f3d955b 100644
--- a/dev/tests/integration/testsuite/Magento/Framework/Composer/_files/testFromCreateProject/cache/.htaccess
+++ b/dev/tests/integration/testsuite/Magento/Framework/Composer/_files/testFromCreateProject/cache/.htaccess
@@ -1 +1,7 @@
-Deny from all
\ No newline at end of file
+
+ deny from all
+
+= 2.4>
+ Require all denied
+
+
diff --git a/dev/tests/integration/testsuite/Magento/Framework/Composer/_files/testSkeleton/.htaccess b/dev/tests/integration/testsuite/Magento/Framework/Composer/_files/testSkeleton/.htaccess
index 14249c50bd760..118789f3d955b 100644
--- a/dev/tests/integration/testsuite/Magento/Framework/Composer/_files/testSkeleton/.htaccess
+++ b/dev/tests/integration/testsuite/Magento/Framework/Composer/_files/testSkeleton/.htaccess
@@ -1 +1,7 @@
-Deny from all
\ No newline at end of file
+
+ deny from all
+
+= 2.4>
+ Require all denied
+
+
diff --git a/dev/tests/integration/testsuite/Magento/Framework/Composer/_files/testSkeleton/cache/.htaccess b/dev/tests/integration/testsuite/Magento/Framework/Composer/_files/testSkeleton/cache/.htaccess
index 14249c50bd760..118789f3d955b 100644
--- a/dev/tests/integration/testsuite/Magento/Framework/Composer/_files/testSkeleton/cache/.htaccess
+++ b/dev/tests/integration/testsuite/Magento/Framework/Composer/_files/testSkeleton/cache/.htaccess
@@ -1 +1,7 @@
-Deny from all
\ No newline at end of file
+
+ deny from all
+
+= 2.4>
+ Require all denied
+
+
diff --git a/generated/.htaccess b/generated/.htaccess
index 93169e4eb44ff..707c26b075e16 100644
--- a/generated/.htaccess
+++ b/generated/.htaccess
@@ -1,2 +1,8 @@
-Order deny,allow
-Deny from all
+
+ order allow,deny
+ deny from all
+
+= 2.4>
+ Require all denied
+
+
diff --git a/lib/.htaccess b/lib/.htaccess
index 93169e4eb44ff..707c26b075e16 100644
--- a/lib/.htaccess
+++ b/lib/.htaccess
@@ -1,2 +1,8 @@
-Order deny,allow
-Deny from all
+
+ order allow,deny
+ deny from all
+
+= 2.4>
+ Require all denied
+
+
diff --git a/phpserver/.htaccess b/phpserver/.htaccess
index 93169e4eb44ff..707c26b075e16 100644
--- a/phpserver/.htaccess
+++ b/phpserver/.htaccess
@@ -1,2 +1,8 @@
-Order deny,allow
-Deny from all
+
+ order allow,deny
+ deny from all
+
+= 2.4>
+ Require all denied
+
+
diff --git a/pub/.htaccess b/pub/.htaccess
index bdae9be342d8d..9d79c1cc2b9a4 100644
--- a/pub/.htaccess
+++ b/pub/.htaccess
@@ -190,8 +190,13 @@
## Deny access to release notes to prevent disclosure of the installed Magento version
- order allow,deny
- deny from all
+
+ order allow,deny
+ deny from all
+
+ = 2.4>
+ Require all denied
+
# For 404s and 403s that aren't handled by the application, show plain 404 response
@@ -207,8 +212,13 @@ ErrorDocument 403 /errors/404.php
###########################################
## Deny access to cron.php
- order allow,deny
- deny from all
+
+ order allow,deny
+ deny from all
+
+ = 2.4>
+ Require all denied
+
diff --git a/pub/media/customer/.htaccess b/pub/media/customer/.htaccess
index 93169e4eb44ff..707c26b075e16 100644
--- a/pub/media/customer/.htaccess
+++ b/pub/media/customer/.htaccess
@@ -1,2 +1,8 @@
-Order deny,allow
-Deny from all
+
+ order allow,deny
+ deny from all
+
+= 2.4>
+ Require all denied
+
+
diff --git a/pub/media/downloadable/.htaccess b/pub/media/downloadable/.htaccess
index 93169e4eb44ff..707c26b075e16 100644
--- a/pub/media/downloadable/.htaccess
+++ b/pub/media/downloadable/.htaccess
@@ -1,2 +1,8 @@
-Order deny,allow
-Deny from all
+
+ order allow,deny
+ deny from all
+
+= 2.4>
+ Require all denied
+
+
diff --git a/pub/media/import/.htaccess b/pub/media/import/.htaccess
index 93169e4eb44ff..707c26b075e16 100644
--- a/pub/media/import/.htaccess
+++ b/pub/media/import/.htaccess
@@ -1,2 +1,8 @@
-Order deny,allow
-Deny from all
+
+ order allow,deny
+ deny from all
+
+= 2.4>
+ Require all denied
+
+
diff --git a/pub/media/theme_customization/.htaccess b/pub/media/theme_customization/.htaccess
index ae8ddd114d94e..2b93da6b4c079 100644
--- a/pub/media/theme_customization/.htaccess
+++ b/pub/media/theme_customization/.htaccess
@@ -1,5 +1,10 @@
Options -Indexes
- Order allow,deny
- Deny from all
+
+ order allow,deny
+ deny from all
+
+ = 2.4>
+ Require all denied
+
diff --git a/setup/config/.htaccess b/setup/config/.htaccess
index 281d5c33db37c..707c26b075e16 100644
--- a/setup/config/.htaccess
+++ b/setup/config/.htaccess
@@ -1,2 +1,8 @@
-order allow,deny
-deny from all
+
+ order allow,deny
+ deny from all
+
+= 2.4>
+ Require all denied
+
+
diff --git a/setup/performance-toolkit/.htaccess b/setup/performance-toolkit/.htaccess
index 281d5c33db37c..707c26b075e16 100644
--- a/setup/performance-toolkit/.htaccess
+++ b/setup/performance-toolkit/.htaccess
@@ -1,2 +1,8 @@
-order allow,deny
-deny from all
+
+ order allow,deny
+ deny from all
+
+= 2.4>
+ Require all denied
+
+
diff --git a/setup/src/.htaccess b/setup/src/.htaccess
index 281d5c33db37c..707c26b075e16 100644
--- a/setup/src/.htaccess
+++ b/setup/src/.htaccess
@@ -1,2 +1,8 @@
-order allow,deny
-deny from all
+
+ order allow,deny
+ deny from all
+
+= 2.4>
+ Require all denied
+
+
diff --git a/setup/view/.htaccess b/setup/view/.htaccess
index 281d5c33db37c..707c26b075e16 100644
--- a/setup/view/.htaccess
+++ b/setup/view/.htaccess
@@ -1,2 +1,8 @@
-order allow,deny
-deny from all
+
+ order allow,deny
+ deny from all
+
+= 2.4>
+ Require all denied
+
+
diff --git a/var/.htaccess b/var/.htaccess
index 896fbc5a341ea..707c26b075e16 100755
--- a/var/.htaccess
+++ b/var/.htaccess
@@ -1,2 +1,8 @@
-Order deny,allow
-Deny from all
\ No newline at end of file
+
+ order allow,deny
+ deny from all
+
+= 2.4>
+ Require all denied
+
+
diff --git a/vendor/.htaccess b/vendor/.htaccess
index cb24fd7fc0b3a..707c26b075e16 100644
--- a/vendor/.htaccess
+++ b/vendor/.htaccess
@@ -1,2 +1,8 @@
-Order allow,deny
-Deny from all
+
+ order allow,deny
+ deny from all
+
+= 2.4>
+ Require all denied
+
+