Skip to content

Commit 2b75771

Browse files
committed
MAGETWO-55664: Portdown MAGETWO-51428 down to M2.0.x branch
(cherry picked from commit 88112d8)
1 parent e441d86 commit 2b75771

File tree

2 files changed

+37
-185
lines changed

2 files changed

+37
-185
lines changed

.htaccess

Lines changed: 12 additions & 184 deletions
Original file line numberDiff line numberDiff line change
@@ -1,206 +1,43 @@
1-
############################################
2-
## overrides deployment configuration mode value
3-
## use command bin/magento deploy:mode:set to switch modes
4-
5-
# SetEnv MAGE_MODE developer
6-
7-
############################################
8-
## uncomment these lines for CGI mode
9-
## make sure to specify the correct cgi php binary file name
10-
## it might be /cgi-bin/php-cgi
11-
12-
# Action php5-cgi /cgi-bin/php5-cgi
13-
# AddHandler php5-cgi .php
14-
15-
############################################
16-
## GoDaddy specific options
17-
18-
# Options -MultiViews
19-
20-
## you might also need to add this line to php.ini
21-
## cgi.fix_pathinfo = 1
22-
## if it still doesn't work, rename php.ini to php5.ini
23-
24-
############################################
25-
## this line is specific for 1and1 hosting
26-
27-
#AddType x-mapp-php5 .php
28-
#AddHandler x-mapp-php5 .php
29-
30-
############################################
31-
## default index file
32-
33-
DirectoryIndex index.php
34-
1+
# All explanations you could find in .htaccess.sample file
2+
DirectoryIndex index.php
353
<IfModule mod_php5.c>
36-
############################################
37-
## adjust memory limit
38-
394
php_value memory_limit 768M
405
php_value max_execution_time 18000
41-
42-
############################################
43-
## disable automatic session start
44-
## before autoload was initialized
45-
466
php_flag session.auto_start off
47-
48-
############################################
49-
## enable resulting html compression
50-
51-
#php_flag zlib.output_compression on
52-
53-
###########################################
54-
## disable user agent verification to not break multiple image upload
55-
567
php_flag suhosin.session.cryptua off
578
</IfModule>
589
<IfModule mod_php7.c>
59-
############################################
60-
## adjust memory limit
61-
6210
php_value memory_limit 768M
6311
php_value max_execution_time 18000
64-
65-
############################################
66-
## disable automatic session start
67-
## before autoload was initialized
68-
6912
php_flag session.auto_start off
70-
71-
############################################
72-
## enable resulting html compression
73-
74-
#php_flag zlib.output_compression on
75-
76-
###########################################
77-
## disable user agent verification to not break multiple image upload
78-
7913
php_flag suhosin.session.cryptua off
8014
</IfModule>
8115
<IfModule mod_security.c>
82-
###########################################
83-
## disable POST processing to not break multiple image upload
84-
8516
SecFilterEngine Off
8617
SecFilterScanPOST Off
8718
</IfModule>
88-
89-
<IfModule mod_deflate.c>
90-
91-
############################################
92-
## enable apache served files compression
93-
## http://developer.yahoo.com/performance/rules.html#gzip
94-
95-
# Insert filter on all content
96-
###SetOutputFilter DEFLATE
97-
# Insert filter on selected content types only
98-
#AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css text/javascript
99-
100-
# Netscape 4.x has some problems...
101-
#BrowserMatch ^Mozilla/4 gzip-only-text/html
102-
103-
# Netscape 4.06-4.08 have some more problems
104-
#BrowserMatch ^Mozilla/4\.0[678] no-gzip
105-
106-
# MSIE masquerades as Netscape, but it is fine
107-
#BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
108-
109-
# Don't compress images
110-
#SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary
111-
112-
# Make sure proxies don't deliver the wrong content
113-
#Header append Vary User-Agent env=!dont-vary
114-
115-
</IfModule>
116-
11719
<IfModule mod_ssl.c>
118-
119-
############################################
120-
## make HTTPS env vars available for CGI mode
121-
12220
SSLOptions StdEnvVars
123-
12421
</IfModule>
125-
126-
############################################
127-
## workaround for Apache 2.4.6 CentOS build when working via ProxyPassMatch with HHVM (or any other)
128-
## Please, set it on virtual host configuration level
129-
130-
## SetEnvIf Authorization "(.*)" HTTP_AUTHORIZATION=$1
131-
############################################
132-
13322
<IfModule mod_rewrite.c>
134-
135-
############################################
136-
## enable rewrites
137-
13823
Options +FollowSymLinks
13924
RewriteEngine on
140-
141-
############################################
142-
## you can put here your magento root folder
143-
## path relative to web root
144-
145-
#RewriteBase /magento/
146-
147-
############################################
148-
## workaround for HTTP authorization
149-
## in CGI environment
150-
15125
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
152-
153-
############################################
154-
## TRACE and TRACK HTTP methods disabled to prevent XSS attacks
155-
15626
RewriteCond %{REQUEST_METHOD} ^TRAC[EK]
15727
RewriteRule .* - [L,R=405]
158-
159-
############################################
160-
## redirect for mobile user agents
161-
162-
#RewriteCond %{REQUEST_URI} !^/mobiledirectoryhere/.*$
163-
#RewriteCond %{HTTP_USER_AGENT} "android|blackberry|ipad|iphone|ipod|iemobile|opera mobile|palmos|webos|googlebot-mobile" [NC]
164-
#RewriteRule ^(.*)$ /mobiledirectoryhere/ [L,R=302]
165-
166-
############################################
167-
## never rewrite for existing files, directories and links
168-
16928
RewriteCond %{REQUEST_FILENAME} !-f
17029
RewriteCond %{REQUEST_FILENAME} !-d
17130
RewriteCond %{REQUEST_FILENAME} !-l
172-
173-
############################################
174-
## rewrite everything else to index.php
175-
17631
RewriteRule .* index.php [L]
177-
17832
</IfModule>
179-
180-
181-
############################################
182-
## Prevent character encoding issues from server overrides
183-
## If you still have problems, use the second line instead
184-
18533
AddDefaultCharset Off
186-
#AddDefaultCharset UTF-8
187-
34+
AddType 'text/html; charset=UTF-8' html
18835
<IfModule mod_expires.c>
189-
190-
############################################
191-
## Add default Expires header
192-
## http://developer.yahoo.com/performance/rules.html#expires
193-
19436
ExpiresDefault "access plus 1 year"
19537
ExpiresByType text/html A0
19638
ExpiresByType text/plain A0
197-
19839
</IfModule>
199-
200-
###########################################
201-
## Deny access to root files to hide sensitive application information
202-
RedirectMatch 404 /\.git
203-
40+
RedirectMatch 403 /\.git
20441
<Files composer.json>
20542
order allow,deny
20643
deny from all
@@ -237,10 +74,6 @@
23774
order allow,deny
23875
deny from all
23976
</Files>
240-
<Files CONTRIBUTOR_LICENSE_AGREEMENT.html>
241-
order allow,deny
242-
deny from all
243-
</Files>
24477
<Files COPYING.txt>
24578
order allow,deny
24679
deny from all
@@ -274,19 +107,14 @@
274107
deny from all
275108
</Files>
276109
<Files magento_umask>
277-
order allow,deny
278-
deny from all
110+
order allow,deny
111+
deny from all
279112
</Files>
280-
281-
################################
282-
## If running in cluster environment, uncomment this
283-
## http://developer.yahoo.com/performance/rules.html#etags
284-
285-
#FileETag none
286-
287-
############################################
288-
## Add custom headers
113+
ErrorDocument 404 /pub/errors/404.php
114+
ErrorDocument 403 /pub/errors/404.php
289115
<IfModule mod_headers.c>
290-
Header set X-Content-Type-Options "nosniff"
291-
Header set X-XSS-Protection "1; mode=block"
116+
Header set X-UA-Compatible "IE=edge"
117+
<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)$">
118+
Header unset X-UA-Compatible
119+
</FilesMatch>
292120
</IfModule>

.htaccess.sample

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,9 @@
3030
############################################
3131
## default index file
3232

33-
DirectoryIndex index.php
33+
DirectoryIndex index.php
3434

35+
<IfModule mod_php5.c>
3536
############################################
3637
## adjust memory limit
3738

@@ -53,7 +54,30 @@
5354
## disable user agent verification to not break multiple image upload
5455

5556
php_flag suhosin.session.cryptua off
57+
</IfModule>
58+
<IfModule mod_php7.c>
59+
############################################
60+
## adjust memory limit
61+
62+
php_value memory_limit 768M
63+
php_value max_execution_time 18000
64+
65+
############################################
66+
## disable automatic session start
67+
## before autoload was initialized
68+
69+
php_flag session.auto_start off
70+
71+
############################################
72+
## enable resulting html compression
73+
74+
#php_flag zlib.output_compression on
5675

76+
###########################################
77+
## disable user agent verification to not break multiple image upload
78+
79+
php_flag suhosin.session.cryptua off
80+
</IfModule>
5781
<IfModule mod_security.c>
5882
###########################################
5983
## disable POST processing to not break multiple image upload

0 commit comments

Comments
 (0)