-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.htaccess
executable file
·567 lines (473 loc) · 14.9 KB
/
.htaccess
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
############################################
#### uncomment these lines for CGI mode
#### make sure to specify the correct cgi
#### php binary file name
#### it might be /cgi-bin/php-cgi
############################################
# Action php5-cgi /cgi-bin/php5-cgi
# AddHandler php5-cgi .php
#mfp enable profiler
#SetEnv MAGE_PROFILER "html"
SetEnv MAGE_MODE developer
############################################
#### default index file
############################################
DirectoryIndex index.php
<IfModule mod_php5.c>
############################################
#### Ajuste de Memory_Limit ####
#### Magento asume 768M por default ####
############################################
#php_value memory_limit 768M
#php_value max_execution_time 18000
############################################
## disable magic quotes for php request vars
############################################
php_flag magic_quotes_gpc off
############################################
## disable automatic session start
## before autoload was initialized
php_flag session.auto_start off
############################################
## enable resulting html compression
# php_flag zlib.output_compression on
###########################################
#### Disable user agent verification ####
#### to not break multiple image ####
#### upload ####
###########################################
php_flag suhosin.session.cryptua off
</IfModule>
<IfModule mod_php7.c>
############################################
#### Ajuste de Memory_Limit ####
#### Magento asume 768M por default ####
############################################
#php_value memory_limit 768M
#php_value max_execution_time 18000
############################################
## disable magic quotes for php request vars
############################################
php_flag magic_quotes_gpc off
############################################
## disable automatic session start
## before autoload was initialized
php_flag session.auto_start off
############################################
## enable resulting html compression
# php_flag zlib.output_compression on
###########################################
#### Disable user agent verification ####
#### to not break multiple image ####
#### upload ####
###########################################
php_flag suhosin.session.cryptua off
</IfModule>
<IfModule mod_security.c>
###########################################
#### Disable POST processing to not
#### break multiple image upload
###########################################
SecFilterEngine Off
SecFilterScanPOST Off
</IfModule>
<IfModule mod_deflate.c>
############################################
#### Enable apache served files compression
#### http://developer.yahoo.com/performance/rules.html#gzip
#### Insert filter on all content
############################################
SetOutputFilter DEFLATE
#### Insert filter on selected content types only
AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css text/javascript application/x-javascript
#### Netscape 4.x has some problems...
BrowserMatch ^Mozilla/4 gzip-only-text/
#### Netscape 4.06-4.08 have some more problems
BrowserMatch ^Mozilla/4\.0[678] no-gzip
#### MSIE masquerades as Netscape, but it is fine
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
#### Don't compress images
SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary
#### Make sure proxies don't deliver the wrong content
Header append Vary User-Agent env=!dont-vary
#### Enable resulting html compression
php_flag zlib.output_compression on
</IfModule>
<IfModule mod_ssl.c>
############################################
#### make HTTPS env vars available for
#### CGI mode
############################################
SSLOptions StdEnvVars
</IfModule>
############################################
#### Workaround for Apache 2.4.6 CentOS
#### build when working via ProxyPassMatch
#### with HHVM (or any other)
#### Please, set it on virtual host configuration level
############################################
# SetEnvIf Authorization "(.*)" HTTP_AUTHORIZATION=$1
############################################
#### Let apache know we're behind a SSL
#### reverse proxy
############################################
SetEnvIf X-Forwarded-Proto "https" HTTPS=on
<IfModule mod_rewrite.c>
############################################
#### Enable ReWrites
############################################
Options +FollowSymLinks
RewriteEngine on
############################################
#### You can put here your magento root
#### folder path relative to web root
# RewriteBase /home/ecommerce/ecommerce/
RewriteBase /
############################################
#### Use Multi Store Yaxa
#### Section of Fabio Baron
############################################
# RewriteCond %{HTTP_HOST} .*yaxa\.com\.mx [NC]
# RewriteRule .* - [E=MAGE_RUN_CODE:mx]
############################################
#### Uncomment next line to enable
#### light API calls processing
############################################
# RewriteRule ^api/([a-z][0-9a-z_]+)/?$ api.php?type=$1 [QSA,L]
############################################
#### Rewrite API2 calls to api.php
#### (by now it is REST only)
############################################
RewriteRule ^api/rest api.php?type=rest [QSA,L]
############################################
#### workaround for HTTP authorization
#### in CGI environment
############################################
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
############################################
#### TRACE and TRACK HTTP methods
#### disabled to prevent XSS attacks
############################################
RewriteCond %{REQUEST_METHOD} ^TRAC[EK]
RewriteRule .* - [L,R=405]
# RedirectMatch 301 /* https://yaxa.co/
# RedirectMatch 301 /index.php/(?!admin)(.*)
<IfModule mod_setenvif.c>
<IfModule mod_headers.c>
############################################
#### X-Content-Type-Options: nosniff
#### disable content-type sniffing on
#### some browsers.
############################################
# Header set X-Content-Type-Options: nosniff
Header set Access-Control-Allow-Origin *
############################################
#### This header forces to enables
#### the Cross-site scripting (XSS)
#### filter in browsers (if disabled)
############################################
BrowserMatch \bMSIE\s8 ie8
Header set X-XSS-Protection: "1; mode=block" env=!ie8
</IfModule>
</IfModule>
############################################
#### Redirect for mobile user agents
############################################
# RewriteCond %{REQUEST_URI} !^/mobiledirectoryhere/.*$
# RewriteCond %{HTTP_USER_AGENT} "android|blackberry|ipad|iphone|ipod|iemobile|opera mobile|palmos|webos|googlebot-mobile" [NC]
# RewriteRule ^(.*)$ /mobiledirectoryhere/ [L,R=302]
############################################
#### always send 404 on missing files
#### in these folders
############################################
RewriteCond %{REQUEST_URI} !^/(media|skin|js)/
############################################
#### Never rewrite for existing files,
#### directories and links
############################################
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-l
############################################
#### Rewrite everything else to index.php
############################################
RewriteRule .* index.php [L]
</IfModule>
############################################
#### Prevent character encoding issues
#### from server overrides
#### If you still have problems, use the
#### second line instead
############################################
AddDefaultCharset Off
# AddDefaultCharset UTF-8
AddType 'text/html; charset=UTF-8' html
<IfModule mod_expires.c>
############################################
#### Add default Expires header
#### http://developer.yahoo.com/performance/rules.html#expires
############################################
# Enable expirations
ExpiresActive On
# Default directive
ExpiresDefault "access plus 1 week"
ExpiresByType text/html A0
ExpiresByType text/plain A0
# My favicon
ExpiresByType image/x-icon "access plus 1 month"
# Images
ExpiresByType image/gif "access plus 1 month"
ExpiresByType image/png "access plus 1 month"
ExpiresByType image/jpg "access plus 1 month"
ExpiresByType image/jpeg "access plus 1 month"
# CSS
ExpiresByType text/css "access 1 month"
# Javascript
ExpiresByType application/javascript "access plus 1 year"
</IfModule>
<Files composer.json>
<IfVersion < 2.4>
order allow,deny
deny from all
</IfVersion>
<IfVersion >= 2.4>
Require all denied
</IfVersion>
</Files>
<Files composer.lock>
<IfVersion < 2.4>
order allow,deny
deny from all
</IfVersion>
<IfVersion >= 2.4>
Require all denied
</IfVersion>
</Files>
<Files .gitignore>
<IfVersion < 2.4>
order allow,deny
deny from all
</IfVersion>
<IfVersion >= 2.4>
Require all denied
</IfVersion>
</Files>
<Files .htaccess>
<IfVersion < 2.4>
order allow,deny
deny from all
</IfVersion>
<IfVersion >= 2.4>
Require all denied
</IfVersion>
</Files>
<Files .htaccess.sample>
<IfVersion < 2.4>
order allow,deny
deny from all
</IfVersion>
<IfVersion >= 2.4>
Require all denied
</IfVersion>
</Files>
<Files .php_cs.dist>
<IfVersion < 2.4>
order allow,deny
deny from all
</IfVersion>
<IfVersion >= 2.4>
Require all denied
</IfVersion>
</Files>
<Files .travis.yml>
<IfVersion < 2.4>
order allow,deny
deny from all
</IfVersion>
<IfVersion >= 2.4>
Require all denied
</IfVersion>
</Files>
<Files CHANGELOG.md>
<IfVersion < 2.4>
order allow,deny
deny from all
</IfVersion>
<IfVersion >= 2.4>
Require all denied
</IfVersion>
</Files>
<Files COPYING.txt>
<IfVersion < 2.4>
order allow,deny
deny from all
</IfVersion>
<IfVersion >= 2.4>
Require all denied
</IfVersion>
</Files>
<Files Gruntfile.js>
<IfVersion < 2.4>
order allow,deny
deny from all
</IfVersion>
<IfVersion >= 2.4>
Require all denied
</IfVersion>
</Files>
<Files LICENSE.txt>
<IfVersion < 2.4>
order allow,deny
deny from all
</IfVersion>
<IfVersion >= 2.4>
Require all denied
</IfVersion>
</Files>
<Files LICENSE_AFL.txt>
<IfVersion < 2.4>
order allow,deny
deny from all
</IfVersion>
<IfVersion >= 2.4>
Require all denied
</IfVersion>
</Files>
<Files nginx.conf.sample>
<IfVersion < 2.4>
order allow,deny
deny from all
</IfVersion>
<IfVersion >= 2.4>
Require all denied
</IfVersion>
</Files>
<Files package.json>
<IfVersion < 2.4>
order allow,deny
deny from all
</IfVersion>
<IfVersion >= 2.4>
Require all denied
</IfVersion>
</Files>
<Files php.ini.sample>
<IfVersion < 2.4>
order allow,deny
deny from all
</IfVersion>
<IfVersion >= 2.4>
Require all denied
</IfVersion>
</Files>
<Files README.md>
<IfVersion < 2.4>
order allow,deny
deny from all
</IfVersion>
<IfVersion >= 2.4>
Require all denied
</IfVersion>
</Files>
<Files auth.json>
<IfVersion < 2.4>
order allow,deny
deny from all
</IfVersion>
<IfVersion >= 2.4>
Require all denied
</IfVersion>
</Files>
<Files magento_umask>
<IfVersion < 2.4>
order allow,deny
deny from all
</IfVersion>
<IfVersion >= 2.4>
Require all denied
</IfVersion>
</Files>
###########################################
## Deny access to release notes to prevent disclosure of the installed Magento version
<Files RELEASE_NOTES.txt>
<IfVersion < 2.4>
order allow,deny
deny from all
</IfVersion>
<IfVersion >= 2.4>
Require all denied
</IfVersion>
</Files>
############################################
#### For 404s and 403s that aren't
#### handled by the application, show
#### plain 404 response
############################################
ErrorDocument 404 /pub/errors/404.php
ErrorDocument 403 /pub/errors/404.php
############################################
#### By default allow all access
############################################
# Order allow,deny
# Allow from all
############################################
#### If running in cluster environment,
#### uncomment this
#### http://developer.yahoo.com/performance/rules.html#etags
############################################
# FileETag none
###########################################
#### Deny access to cron.php
###########################################
<Files cron.php>
############################################
#### Uncomment next lines to enable cron
#### access with base HTTP authorization
#### http://httpd.apache.org/docs/2.2/howto/auth.html
####
#### Warning: .htpasswd file should be
#### placed somewhere not accessible
#### from the web.
####
#### This is so that folks cannot
#### download the password file.
####
#### For example, if your documents are
#### served out of /usr/local/apache/htdocs
#### you might want to put the password
#### file(s) in /usr/local/apache/.
############################################
# AuthName "Cron auth"
# AuthUserFile ../.htpasswd
# AuthType basic
# Require valid-user
Order allow,deny
Deny from all
</Files>
# ######################################################################
# # INTERNET EXPLORER #
# ######################################################################
# ----------------------------------------------------------------------
# | Document modes |
# ----------------------------------------------------------------------
# Force Internet Explorer 8/9/10 to render pages in the highest mode
# available in the various cases when it may not.
#
# https://hsivonen.fi/doctype/#ie8
#
# (!) Starting with Internet Explorer 11, document modes are deprecated.
# If your business still relies on older web apps and services that were
# designed for older versions of Internet Explorer, you might want to
# consider enabling `Enterprise Mode` throughout your company.
#
# https://msdn.microsoft.com/en-us/library/ie/bg182625.aspx#docmode
# http://blogs.msdn.com/b/ie/archive/2014/04/02/stay-up-to-date-with-enterprise-mode-for-internet-explorer-11.aspx
<IfModule mod_headers.c>
Header set X-UA-Compatible "IE=edge"
# `mod_headers` cannot match based on the content-type, however,
# the `X-UA-Compatible` response header should be send only for
# HTML documents and not for the other resources.
<FilesMatch "\.(appcache|atom|bbaw|bmp|crx|css|cur|eot|f4[abpv]|flv|geojson|gif|htc|ico|jpe?g|js|json(ld)?|m4[av]|manifest|map|mp4|oex|og[agv]|opus|otf|pdf|png|rdf|rss|safariextz|svgz?|swf|topojson|tt[cf]|txt|vcard|vcf|vtt|webapp|web[mp]|webmanifest|woff2?|xloc|xml|xpi)$">
Header unset X-UA-Compatible
</FilesMatch>
</IfModule>