.htaccess 6.2 KB

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