2.13.9.4. Стандартные .htaccess для Magento

Пример содержимого стандартных .htaccess для Magento 2.4 (GitHub):

  • Из корневого каталога сайта:
    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. ## enable usage of methods arguments in backtrace
    32.  
    33. SetEnv MAGE_DEBUG_SHOW_ARGS 1
    34.  
    35. ############################################
    36. ## default index file
    37.  
    38. DirectoryIndex index.php
    39.  
    40. <IfModule mod_php7.c>
    41. ############################################
    42. ## adjust memory limit
    43.  
    44. php_value memory_limit 756M
    45. php_value max_execution_time 18000
    46.  
    47. ############################################
    48. ## disable automatic session start
    49. ## before autoload was initialized
    50.  
    51. php_flag session.auto_start off
    52.  
    53. ############################################
    54. ## enable resulting html compression
    55.  
    56. #php_flag zlib.output_compression on
    57.  
    58. ###########################################
    59. ## disable user agent verification to not break multiple image upload
    60.  
    61. php_flag suhosin.session.cryptua off
    62. </IfModule>
    63. <IfModule mod_security.c>
    64. ###########################################
    65. ## disable POST processing to not break multiple image upload
    66.  
    67. SecFilterEngine Off
    68. SecFilterScanPOST Off
    69. </IfModule>
    70.  
    71. <IfModule mod_deflate.c>
    72.  
    73. ############################################
    74. ## enable apache served files compression
    75. ## http://developer.yahoo.com/performance/rules.html#gzip
    76.  
    77. # Insert filter on all content
    78. ###SetOutputFilter DEFLATE
    79. # Insert filter on selected content types only
    80. #AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css text/javascript application/javascript application/x-javascript application/json image/svg+xml
    81.  
    82. # Netscape 4.x has some problems...
    83. #BrowserMatch ^Mozilla/4 gzip-only-text/html
    84.  
    85. # Netscape 4.06-4.08 have some more problems
    86. #BrowserMatch ^Mozilla/4\.0[678] no-gzip
    87.  
    88. # MSIE masquerades as Netscape, but it is fine
    89. #BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
    90.  
    91. # Don't compress images
    92. #SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary
    93.  
    94. # Make sure proxies don't deliver the wrong content
    95. #Header append Vary User-Agent env=!dont-vary
    96.  
    97. </IfModule>
    98.  
    99. <IfModule mod_ssl.c>
    100.  
    101. ############################################
    102. ## make HTTPS env vars available for CGI mode
    103.  
    104. SSLOptions StdEnvVars
    105.  
    106. </IfModule>
    107.  
    108. ############################################
    109. ## workaround for Apache 2.4.6 CentOS build when working via ProxyPassMatch with HHVM (or any other)
    110. ## Please, set it on virtual host configuration level
    111.  
    112. ## SetEnvIf Authorization "(.*)" HTTP_AUTHORIZATION=$1
    113. ############################################
    114.  
    115. <IfModule mod_rewrite.c>
    116.  
    117. ############################################
    118. ## enable rewrites
    119.  
    120. Options +SymLinksIfOwnerMatch
    121. RewriteEngine on
    122.  
    123. ############################################
    124. ## you can put here your magento root folder
    125. ## path relative to web root
    126.  
    127. #RewriteBase /magento/
    128.  
    129. ############################################
    130. ## workaround for HTTP authorization
    131. ## in CGI environment
    132.  
    133. RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
    134.  
    135. ############################################
    136. ## TRACE and TRACK HTTP methods disabled to prevent XSS attacks
    137.  
    138. RewriteCond %{REQUEST_METHOD} ^TRAC[EK]
    139. RewriteRule .* - [L,R=405]
    140.  
    141. ############################################
    142. ## redirect for mobile user agents
    143.  
    144. #RewriteCond %{REQUEST_URI} !^/mobiledirectoryhere/.*$
    145. #RewriteCond %{HTTP_USER_AGENT} "android|blackberry|ipad|iphone|ipod|iemobile|opera mobile|palmos|webos|googlebot-mobile" [NC]
    146. #RewriteRule ^(.*)$ /mobiledirectoryhere/ [L,R=302]
    147.  
    148. ############################################
    149. ## never rewrite for existing files, directories and links
    150.  
    151. RewriteCond %{REQUEST_FILENAME} !-f
    152. RewriteCond %{REQUEST_FILENAME} !-d
    153. RewriteCond %{REQUEST_FILENAME} !-l
    154.  
    155. ############################################
    156. ## rewrite everything else to index.php
    157.  
    158. RewriteRule .* index.php [L]
    159.  
    160. </IfModule>
    161.  
    162.  
    163. ############################################
    164. ## Prevent character encoding issues from server overrides
    165. ## If you still have problems, use the second line instead
    166.  
    167. AddDefaultCharset Off
    168. #AddDefaultCharset UTF-8
    169. AddType 'text/html; charset=UTF-8' html
    170.  
    171. <IfModule mod_expires.c>
    172.  
    173. ############################################
    174. ## Add default Expires header
    175. ## http://developer.yahoo.com/performance/rules.html#expires
    176.  
    177. ExpiresDefault "access plus 1 year"
    178. ExpiresByType text/html A0
    179. ExpiresByType text/plain A0
    180.  
    181. </IfModule>
    182.  
    183. ###########################################
    184. ## Deny access to root files to hide sensitive application information
    185. RedirectMatch 403 /\.git
    186.  
    187. <Files composer.json>
    188. # <IfVersion < 2.4>
    189. # order allow,deny
    190. # deny from all
    191. # </IfVersion>
    192. # <IfVersion >= 2.4>
    193. Require all denied
    194. # </IfVersion>
    195. </Files>
    196. <Files composer.lock>
    197. # <IfVersion < 2.4>
    198. # order allow,deny
    199. # deny from all
    200. # </IfVersion>
    201. # <IfVersion >= 2.4>
    202. Require all denied
    203. # </IfVersion>
    204. </Files>
    205. <Files .gitignore>
    206. # <IfVersion < 2.4>
    207. # order allow,deny
    208. # deny from all
    209. # </IfVersion>
    210. # <IfVersion >= 2.4>
    211. Require all denied
    212. # </IfVersion>
    213. </Files>
    214. <Files .htaccess>
    215. # <IfVersion < 2.4>
    216. # order allow,deny
    217. # deny from all
    218. # </IfVersion>
    219. # <IfVersion >= 2.4>
    220. Require all denied
    221. # </IfVersion>
    222. </Files>
    223. <Files .htaccess.sample>
    224. # <IfVersion < 2.4>
    225. # order allow,deny
    226. # deny from all
    227. # </IfVersion>
    228. # <IfVersion >= 2.4>
    229. Require all denied
    230. # </IfVersion>
    231. </Files>
    232. <Files .php_cs.dist>
    233. # <IfVersion < 2.4>
    234. # order allow,deny
    235. # deny from all
    236. # </IfVersion>
    237. # <IfVersion >= 2.4>
    238. Require all denied
    239. # </IfVersion>
    240. </Files>
    241. <Files .travis.yml>
    242. # <IfVersion < 2.4>
    243. # order allow,deny
    244. # deny from all
    245. # </IfVersion>
    246. # <IfVersion >= 2.4>
    247. Require all denied
    248. # </IfVersion>
    249. </Files>
    250. <Files CHANGELOG.md>
    251. # <IfVersion < 2.4>
    252. # order allow,deny
    253. # deny from all
    254. # </IfVersion>
    255. # <IfVersion >= 2.4>
    256. Require all denied
    257. # </IfVersion>
    258. </Files>
    259. <Files COPYING.txt>
    260. # <IfVersion < 2.4>
    261. # order allow,deny
    262. # deny from all
    263. # </IfVersion>
    264. # <IfVersion >= 2.4>
    265. Require all denied
    266. # </IfVersion>
    267. </Files>
    268. <Files Gruntfile.js>
    269. # <IfVersion < 2.4>
    270. # order allow,deny
    271. # deny from all
    272. # </IfVersion>
    273. # <IfVersion >= 2.4>
    274. Require all denied
    275. # </IfVersion>
    276. </Files>
    277. <Files LICENSE.txt>
    278. # <IfVersion < 2.4>
    279. # order allow,deny
    280. # deny from all
    281. # </IfVersion>
    282. # <IfVersion >= 2.4>
    283. Require all denied
    284. # </IfVersion>
    285. </Files>
    286. <Files LICENSE_AFL.txt>
    287. # <IfVersion < 2.4>
    288. # order allow,deny
    289. # deny from all
    290. # </IfVersion>
    291. # <IfVersion >= 2.4>
    292. Require all denied
    293. # </IfVersion>
    294. </Files>
    295. <Files nginx.conf.sample>
    296. # <IfVersion < 2.4>
    297. # order allow,deny
    298. # deny from all
    299. # </IfVersion>
    300. # <IfVersion >= 2.4>
    301. Require all denied
    302. # </IfVersion>
    303. </Files>
    304. <Files package.json>
    305. # <IfVersion < 2.4>
    306. # order allow,deny
    307. # deny from all
    308. # </IfVersion>
    309. # <IfVersion >= 2.4>
    310. Require all denied
    311. # </IfVersion>
    312. </Files>
    313. <Files php.ini.sample>
    314. # <IfVersion < 2.4>
    315. # order allow,deny
    316. # deny from all
    317. # </IfVersion>
    318. # <IfVersion >= 2.4>
    319. Require all denied
    320. # </IfVersion>
    321. </Files>
    322. <Files README.md>
    323. # <IfVersion < 2.4>
    324. # order allow,deny
    325. # deny from all
    326. # </IfVersion>
    327. # <IfVersion >= 2.4>
    328. Require all denied
    329. # </IfVersion>
    330. </Files>
    331. <Files magento_umask>
    332. # <IfVersion < 2.4>
    333. # order allow,deny
    334. # deny from all
    335. # </IfVersion>
    336. # <IfVersion >= 2.4>
    337. Require all denied
    338. # </IfVersion>
    339. </Files>
    340. <Files auth.json>
    341. # <IfVersion < 2.4>
    342. # order allow,deny
    343. # deny from all
    344. # </IfVersion>
    345. # <IfVersion >= 2.4>
    346. Require all denied
    347. # </IfVersion>
    348. </Files>
    349. <Files .user.ini>
    350. # <IfVersion < 2.4>
    351. # order allow,deny
    352. # deny from all
    353. # </IfVersion>
    354. # <IfVersion >= 2.4>
    355. Require all denied
    356. # </IfVersion>
    357. </Files>
    358.  
    359. # For 404s and 403s that aren't handled by the application, show plain 404 response
    360. ErrorDocument 404 /pub/errors/404.php
    361. ErrorDocument 403 /pub/errors/404.php
    362.  
    363. ################################
    364. ## If running in cluster environment, uncomment this
    365. ## http://developer.yahoo.com/performance/rules.html#etags
    366.  
    367. #FileETag none
    368.  
    369. # ######################################################################
    370. # # INTERNET EXPLORER #
    371. # ######################################################################
    372.  
    373. # ----------------------------------------------------------------------
    374. # | Document modes |
    375. # ----------------------------------------------------------------------
    376.  
    377. # Force Internet Explorer 8/9/10 to render pages in the highest mode
    378. # available in the various cases when it may not.
    379. #
    380. # https://hsivonen.fi/doctype/#ie8
    381. #
    382. # (!) Starting with Internet Explorer 11, document modes are deprecated.
    383. # If your business still relies on older web apps and services that were
    384. # designed for older versions of Internet Explorer, you might want to
    385. # consider enabling `Enterprise Mode` throughout your company.
    386. #
    387. # https://msdn.microsoft.com/en-us/library/ie/bg182625.aspx#docmode
    388. # http://blogs.msdn.com/b/ie/archive/2014/04/02/stay-up-to-date-with-enterprise-mode-for-internet-explorer-11.aspx
    389.  
    390. <IfModule mod_headers.c>
    391.  
    392. Header set X-UA-Compatible "IE=edge"
    393.  
    394. # `mod_headers` cannot match based on the content-type, however,
    395. # the `X-UA-Compatible` response header should be send only for
    396. # HTML documents and not for the other resources.
    397.  
    398. <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)$">
    399. Header unset X-UA-Compatible
    400. </FilesMatch>
    401.  
    402. </IfModule>

    Для совместимости с нашим хостингом изменена директива в строке 120 и закомментирован ряд директив в диапазоне строк 188-356.

  • Из подкаталога pub (GitHub):
    1. ############################################
    2. ## Optional override of deployment mode. We recommend you use the
    3. ## command bin/magento deploy:mode:set to switch modes instead
    4.  
    5. # Options are default, production, or developer
    6. # SetEnv MAGE_MODE default
    7.  
    8. ############################################
    9. ## Uncomment these lines for CGI mode.
    10. ## Make sure to specify the correct cgi php binary file name
    11. ## it might be /cgi-bin/php-cgi
    12.  
    13. # Action php5-cgi /cgi-bin/php5-cgi
    14. # AddHandler php5-cgi .php
    15.  
    16. ############################################
    17. ## GoDaddy specific options
    18.  
    19. # Options -MultiViews
    20.  
    21. ## You might also need to add this line to php.ini
    22. ## cgi.fix_pathinfo = 1
    23. ## If it still doesn't work, rename php.ini to php5.ini
    24.  
    25. ############################################
    26. ## This line is specific for 1and1 hosting
    27.  
    28. #AddType x-mapp-php5 .php
    29. #AddHandler x-mapp-php5 .php
    30.  
    31. ############################################
    32. ## Default index file
    33.  
    34. DirectoryIndex index.php
    35.  
    36. <IfModule mod_php5.c>
    37. ############################################
    38. ## Adjust memory limit
    39.  
    40. php_value memory_limit 756M
    41. php_value max_execution_time 18000
    42.  
    43. ############################################
    44. ## Disable automatic session start
    45. ## before autoload was initialized
    46.  
    47. php_flag session.auto_start off
    48.  
    49. ############################################
    50. # Disable user agent verification to not break multiple image upload
    51.  
    52. php_flag suhosin.session.cryptua off
    53. </IfModule>
    54. <IfModule mod_php7.c>
    55. ############################################
    56. ## Adjust memory limit
    57.  
    58. php_value memory_limit 756M
    59. php_value max_execution_time 18000
    60.  
    61. ############################################
    62. ## Disable automatic session start
    63. ## before autoload was initialized
    64.  
    65. php_flag session.auto_start off
    66.  
    67. ############################################
    68. ## Enable resulting html compression
    69.  
    70. #php_flag zlib.output_compression on
    71.  
    72. ###########################################
    73. # Disable user agent verification to not break multiple image upload
    74.  
    75. php_flag suhosin.session.cryptua off
    76. </IfModule>
    77.  
    78.  
    79. <IfModule mod_security.c>
    80. ###########################################
    81. # Disable POST processing to not break multiple image upload
    82.  
    83. SecFilterEngine Off
    84. SecFilterScanPOST Off
    85. </IfModule>
    86.  
    87. <IfModule mod_deflate.c>
    88.  
    89. ############################################
    90. ## Enable apache served files compression
    91. ## http://developer.yahoo.com/performance/rules.html#gzip
    92.  
    93. # Insert filter on all content
    94. ###SetOutputFilter DEFLATE
    95. # Insert filter on selected content types only
    96. #AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css text/javascript
    97.  
    98. # Netscape 4.x has some problems...
    99. #BrowserMatch ^Mozilla/4 gzip-only-text/html
    100.  
    101. # Netscape 4.06-4.08 have some more problems
    102. #BrowserMatch ^Mozilla/4\.0[678] no-gzip
    103.  
    104. # MSIE masquerades as Netscape, but it is fine
    105. #BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
    106.  
    107. # Don't compress images
    108. #SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary
    109.  
    110. # Make sure proxies don't deliver the wrong content
    111. #Header append Vary User-Agent env=!dont-vary
    112.  
    113. </IfModule>
    114.  
    115. <IfModule mod_ssl.c>
    116.  
    117. ############################################
    118. ## Make HTTPS env vars available for CGI mode
    119.  
    120. SSLOptions StdEnvVars
    121.  
    122. </IfModule>
    123.  
    124. <IfModule mod_rewrite.c>
    125.  
    126. ############################################
    127. ## Enable rewrites
    128.  
    129. Options +SymLinksIfOwnerMatch
    130. RewriteEngine on
    131.  
    132. ############################################
    133. ## You can put here your magento root folder
    134. ## path relative to web root
    135.  
    136. #RewriteBase /magento/
    137.  
    138. ############################################
    139. ## Workaround for HTTP authorization
    140. ## in CGI environment
    141.  
    142. RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
    143.  
    144. ############################################
    145. ## TRACE and TRACK HTTP methods disabled to prevent XSS attacks
    146.  
    147. RewriteCond %{REQUEST_METHOD} ^TRAC[EK]
    148. RewriteRule .* - [L,R=405]
    149.  
    150. ############################################
    151. ## Never rewrite for existing files, directories and links
    152.  
    153. RewriteCond %{REQUEST_FILENAME} !-f
    154. RewriteCond %{REQUEST_FILENAME} !-d
    155. RewriteCond %{REQUEST_FILENAME} !-l
    156.  
    157. ############################################
    158. ## Rewrite everything else to index.php
    159.  
    160. RewriteRule .* index.php [L]
    161.  
    162. </IfModule>
    163.  
    164.  
    165. ############################################
    166. ## Prevent character encoding issues from server overrides
    167. ## If you still have problems, use the second line instead
    168.  
    169. AddDefaultCharset Off
    170. #AddDefaultCharset UTF-8
    171.  
    172. <IfModule mod_expires.c>
    173.  
    174. ############################################
    175. ## Add default Expires header
    176. ## http://developer.yahoo.com/performance/rules.html#expires
    177.  
    178. ExpiresDefault "access plus 1 year"
    179. ExpiresByType text/html A0
    180. ExpiresByType text/plain A0
    181.  
    182. </IfModule>
    183.  
    184. ###########################################
    185. ## Deny access to release notes to prevent disclosure of the installed Magento version
    186.  
    187. <Files RELEASE_NOTES.txt>
    188. # <IfVersion < 2.4>
    189. # order allow,deny
    190. # deny from all
    191. # </IfVersion>
    192. # <IfVersion >= 2.4>
    193. Require all denied
    194. # </IfVersion>
    195. </Files>
    196.  
    197. # For 404s and 403s that aren't handled by the application, show plain 404 response
    198. ErrorDocument 404 /errors/404.php
    199. ErrorDocument 403 /errors/404.php
    200.  
    201. ############################################
    202. ## If running in cluster environment, uncomment this
    203. ## http://developer.yahoo.com/performance/rules.html#etags
    204.  
    205. #FileETag none
    206.  
    207. ###########################################
    208. ## Deny access to cron.php
    209. <Files cron.php>
    210. # <IfVersion < 2.4>
    211. # order allow,deny
    212. # deny from all
    213. # </IfVersion>
    214. # <IfVersion >= 2.4>
    215. Require all denied
    216. # </IfVersion>
    217. </Files>
    218. ## Deny access to .user.ini
    219. <Files .user.ini>
    220. # <IfVersion < 2.4>
    221. # order allow,deny
    222. # deny from all
    223. # </IfVersion>
    224. # <IfVersion >= 2.4>
    225. Require all denied
    226. # </IfVersion>
    227. </Files>
    228.  
    229. <IfModule mod_headers.c>
    230. ############################################
    231. ## Prevent clickjacking
    232. Header set X-Frame-Options SAMEORIGIN
    233. </IfModule>

    Для совместимости с нашим хостингом изменена директива в строке 129 и закомментирован ряд директив в диапазоне строк 188-226.

  • Из подкаталога pub/static (GitHub):
    1. <IfModule mod_php5.c>
    2. php_flag engine 0
    3. </IfModule>
    4.  
    5. <IfModule mod_php7.c>
    6. php_flag engine 0
    7. </IfModule>
    8.  
    9. # To avoid situation when web server automatically adds extension to path
    10. Options -MultiViews
    11.  
    12. <IfModule mod_rewrite.c>
    13. RewriteEngine On
    14.  
    15. ## you can put here your pub/static folder path relative to web root
    16. #RewriteBase /magento/pub/static/
    17.  
    18. # Remove signature of the static files that is used to overcome the browser cache
    19. RewriteRule ^version.+?/(.+)$ $1 [L]
    20.  
    21. RewriteCond %{REQUEST_FILENAME} !-f
    22. RewriteCond %{REQUEST_FILENAME} !-l
    23.  
    24. RewriteRule .* ../static.php?resource=$0 [L]
    25. # Detects if moxieplayer request with uri params and redirects to uri without params
    26. <Files moxieplayer.swf>
    27. RewriteCond %{QUERY_STRING} !^$
    28. RewriteRule ^(.*)$ %{REQUEST_URI}? [R=301,L]
    29. </Files>
    30. </IfModule>
    31.  
    32. ############################################
    33. ## setting MIME types
    34.  
    35. # JavaScript
    36. AddType application/javascript js jsonp
    37. AddType application/json json
    38.  
    39. # HTML
    40.  
    41. AddType text/html html
    42.  
    43. # CSS
    44. AddType text/css css
    45.  
    46. # Images and icons
    47. AddType image/x-icon ico
    48. AddType image/gif gif
    49. AddType image/png png
    50. AddType image/jpeg jpg
    51. AddType image/jpeg jpeg
    52.  
    53. # SVG
    54. AddType image/svg+xml svg
    55.  
    56. # Fonts
    57. AddType application/vnd.ms-fontobject eot
    58. AddType application/x-font-ttf ttf
    59. AddType application/x-font-otf otf
    60. AddType application/x-font-woff woff
    61. AddType application/font-woff2 woff2
    62.  
    63. # Flash
    64. AddType application/x-shockwave-flash swf
    65.  
    66. # Archives and exports
    67. AddType application/zip gzip
    68. AddType application/x-gzip gz gzip
    69. AddType application/x-bzip2 bz2
    70. AddType text/csv csv
    71. AddType application/xml xml
    72.  
    73. <IfModule mod_headers.c>
    74.  
    75. <FilesMatch .*\.(ico|jpg|jpeg|png|gif|svg|js|css|swf|eot|ttf|otf|woff|woff2|html|json)$>
    76. Header append Cache-Control public
    77. </FilesMatch>
    78.  
    79. <FilesMatch .*\.(zip|gz|gzip|bz2|csv|xml)$>
    80. Header append Cache-Control no-store
    81. </FilesMatch>
    82.  
    83. </IfModule>
    84.  
    85. <IfModule mod_expires.c>
    86.  
    87. ############################################
    88. ## Add default Expires header
    89. ## http://developer.yahoo.com/performance/rules.html#expires
    90.  
    91. ExpiresActive On
    92.  
    93. # Data
    94. <FilesMatch \.(zip|gz|gzip|bz2|csv|xml)$>
    95. ExpiresDefault "access plus 0 seconds"
    96. </FilesMatch>
    97. ExpiresByType text/xml "access plus 0 seconds"
    98. ExpiresByType text/csv "access plus 0 seconds"
    99. ExpiresByType application/json "access plus 0 seconds"
    100. ExpiresByType application/zip "access plus 0 seconds"
    101. ExpiresByType application/x-gzip "access plus 0 seconds"
    102. ExpiresByType application/x-bzip2 "access plus 0 seconds"
    103.  
    104. # CSS, JavaScript, html
    105. <FilesMatch \.(css|js|html|json)$>
    106. ExpiresDefault "access plus 1 year"
    107. </FilesMatch>
    108. ExpiresByType text/css "access plus 1 year"
    109. ExpiresByType text/html "access plus 1 year"
    110. ExpiresByType application/javascript "access plus 1 year"
    111. ExpiresByType application/json "access plus 1 year"
    112.  
    113. # Favicon, images, flash
    114. <FilesMatch \.(ico|gif|png|jpg|jpeg|swf|svg)$>
    115. ExpiresDefault "access plus 1 year"
    116. </FilesMatch>
    117. ExpiresByType image/gif "access plus 1 year"
    118. ExpiresByType image/png "access plus 1 year"
    119. ExpiresByType image/jpg "access plus 1 year"
    120. ExpiresByType image/jpeg "access plus 1 year"
    121. ExpiresByType image/svg+xml "access plus 1 year"
    122.  
    123. # Fonts
    124. <FilesMatch \.(eot|ttf|otf|svg|woff|woff2)$>
    125. ExpiresDefault "access plus 1 year"
    126. </FilesMatch>
    127. ExpiresByType application/vnd.ms-fontobject "access plus 1 year"
    128. ExpiresByType application/x-font-ttf "access plus 1 year"
    129. ExpiresByType application/x-font-otf "access plus 1 year"
    130. ExpiresByType application/x-font-woff "access plus 1 year"
    131. ExpiresByType application/font-woff2 "access plus 1 year"
    132.  
    133. </IfModule>
  • hosting/cms/magento/htaccess.txt
  • Последнее изменение: 2020/06/05 13:47
  • (внешнее изменение)