Skip to content

Commit 4562a39

Browse files
committed
#11459: Migrates Apache Access Syntax to 2.4
- updated additional .htaccess files
1 parent f95c69e commit 4562a39

File tree

3 files changed

+133
-38
lines changed

3 files changed

+133
-38
lines changed

.github/.htaccess

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,7 @@
1-
Order deny,allow
2-
Deny from all
1+
<IfVersion < 2.4>
2+
Order deny,allow
3+
Deny from all
4+
</IfVersion>
5+
<IfVersion >= 2.4>
6+
Require all denied
7+
</IfVersion>

.htaccess.sample

Lines changed: 119 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -179,72 +179,157 @@
179179
RedirectMatch 403 /\.git
180180

181181
<Files composer.json>
182-
order allow,deny
183-
deny from all
182+
<IfVersion < 2.4>
183+
order allow,deny
184+
deny from all
185+
</IfVersion>
186+
<IfVersion >= 2.4>
187+
Require all denied
188+
</IfVersion>
184189
</Files>
185190
<Files composer.lock>
186-
order allow,deny
187-
deny from all
191+
<IfVersion < 2.4>
192+
order allow,deny
193+
deny from all
194+
</IfVersion>
195+
<IfVersion >= 2.4>
196+
Require all denied
197+
</IfVersion>
188198
</Files>
189199
<Files .gitignore>
190-
order allow,deny
191-
deny from all
200+
<IfVersion < 2.4>
201+
order allow,deny
202+
deny from all
203+
</IfVersion>
204+
<IfVersion >= 2.4>
205+
Require all denied
206+
</IfVersion>
192207
</Files>
193208
<Files .htaccess>
194-
order allow,deny
195-
deny from all
209+
<IfVersion < 2.4>
210+
order allow,deny
211+
deny from all
212+
</IfVersion>
213+
<IfVersion >= 2.4>
214+
Require all denied
215+
</IfVersion>
196216
</Files>
197217
<Files .htaccess.sample>
198-
order allow,deny
199-
deny from all
218+
<IfVersion < 2.4>
219+
order allow,deny
220+
deny from all
221+
</IfVersion>
222+
<IfVersion >= 2.4>
223+
Require all denied
224+
</IfVersion>
200225
</Files>
201226
<Files .php_cs.dist>
202-
order allow,deny
203-
deny from all
227+
<IfVersion < 2.4>
228+
order allow,deny
229+
deny from all
230+
</IfVersion>
231+
<IfVersion >= 2.4>
232+
Require all denied
233+
</IfVersion>
204234
</Files>
205235
<Files .travis.yml>
206-
order allow,deny
207-
deny from all
236+
<IfVersion < 2.4>
237+
order allow,deny
238+
deny from all
239+
</IfVersion>
240+
<IfVersion >= 2.4>
241+
Require all denied
242+
</IfVersion>
208243
</Files>
209244
<Files CHANGELOG.md>
210-
order allow,deny
211-
deny from all
245+
<IfVersion < 2.4>
246+
order allow,deny
247+
deny from all
248+
</IfVersion>
249+
<IfVersion >= 2.4>
250+
Require all denied
251+
</IfVersion>
212252
</Files>
213253
<Files COPYING.txt>
214-
order allow,deny
215-
deny from all
254+
<IfVersion < 2.4>
255+
order allow,deny
256+
deny from all
257+
</IfVersion>
258+
<IfVersion >= 2.4>
259+
Require all denied
260+
</IfVersion>
216261
</Files>
217262
<Files Gruntfile.js>
218-
order allow,deny
219-
deny from all
263+
<IfVersion < 2.4>
264+
order allow,deny
265+
deny from all
266+
</IfVersion>
267+
<IfVersion >= 2.4>
268+
Require all denied
269+
</IfVersion>
220270
</Files>
221271
<Files LICENSE.txt>
222-
order allow,deny
223-
deny from all
272+
<IfVersion < 2.4>
273+
order allow,deny
274+
deny from all
275+
</IfVersion>
276+
<IfVersion >= 2.4>
277+
Require all denied
278+
</IfVersion>
224279
</Files>
225280
<Files LICENSE_AFL.txt>
226-
order allow,deny
227-
deny from all
281+
<IfVersion < 2.4>
282+
order allow,deny
283+
deny from all
284+
</IfVersion>
285+
<IfVersion >= 2.4>
286+
Require all denied
287+
</IfVersion>
228288
</Files>
229289
<Files nginx.conf.sample>
230-
order allow,deny
231-
deny from all
290+
<IfVersion < 2.4>
291+
order allow,deny
292+
deny from all
293+
</IfVersion>
294+
<IfVersion >= 2.4>
295+
Require all denied
296+
</IfVersion>
232297
</Files>
233298
<Files package.json>
234-
order allow,deny
235-
deny from all
299+
<IfVersion < 2.4>
300+
order allow,deny
301+
deny from all
302+
</IfVersion>
303+
<IfVersion >= 2.4>
304+
Require all denied
305+
</IfVersion>
236306
</Files>
237307
<Files php.ini.sample>
238-
order allow,deny
239-
deny from all
308+
<IfVersion < 2.4>
309+
order allow,deny
310+
deny from all
311+
</IfVersion>
312+
<IfVersion >= 2.4>
313+
Require all denied
314+
</IfVersion>
240315
</Files>
241316
<Files README.md>
242-
order allow,deny
243-
deny from all
317+
<IfVersion < 2.4>
318+
order allow,deny
319+
deny from all
320+
</IfVersion>
321+
<IfVersion >= 2.4>
322+
Require all denied
323+
</IfVersion>
244324
</Files>
245325
<Files magento_umask>
246-
order allow,deny
247-
deny from all
326+
<IfVersion < 2.4>
327+
order allow,deny
328+
deny from all
329+
</IfVersion>
330+
<IfVersion >= 2.4>
331+
Require all denied
332+
</IfVersion>
248333
</Files>
249334

250335
# For 404s and 403s that aren't handled by the application, show plain 404 response

dev/tests/functional/.htaccess.sample

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
##############################################
22
## Allow access to command.php, website.php, export.php, pathChecker.php, locales.php, deleteMagentoGeneratedCode.php and log.php
33
<FilesMatch "command.php|website.php|export.php|pathChecker.php|deleteMagentoGeneratedCode.php|log.php|locales.php">
4-
order allow,deny
5-
allow from all
4+
<IfVersion < 2.4>
5+
order allow,deny
6+
allow from all
7+
</IfVersion>
8+
<IfVersion >= 2.4>
9+
Require all granted
10+
</IfVersion>
611
</FilesMatch>

0 commit comments

Comments
 (0)