.htaccess 3.7 KB

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