Advertisement
Mr_media

magento2_htaccess

Nov 19th, 2016
193
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.80 KB | None | 0 0
  1. ############################################
  2. ## uncomment these lines for CGI mode
  3. ## make sure to specify the correct cgi php binary file name
  4. ## it might be /cgi-bin/php-cgi
  5.  
  6. # Action php5-cgi /cgi-bin/php5-cgi
  7. # AddHandler php5-cgi .php
  8.  
  9.  
  10. SetEnv MAGE_MODE developer
  11. #Magento Developer Mode
  12. #SetEnv MAGE_IS_DEVELOPER_MODE "true"
  13. ############################################
  14. ## GoDaddy specific options
  15.  
  16. # Options -MultiViews
  17.  
  18. ## you might also need to add this line to php.ini
  19. ## cgi.fix_pathinfo = 1
  20. ## if it still doesn't work, rename php.ini to php5.ini
  21.  
  22. ############################################
  23. ## this line is specific for 1and1 hosting
  24.  
  25. #AddType x-mapp-php5 .php
  26. #AddHandler x-mapp-php5 .php
  27.  
  28. ############################################
  29. ## default index file
  30.  
  31. DirectoryIndex index.php
  32.  
  33. <IfModule mod_php5.c>
  34.  
  35. ############################################
  36. ## adjust memory limit
  37.  
  38. # php_value memory_limit 64M
  39. php_value memory_limit 10246M
  40. php_value max_execution_time 18000
  41.  
  42. ############################################
  43. ## disable magic quotes for php request vars
  44.  
  45. php_flag magic_quotes_gpc off
  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.  
  63. ###########################################
  64. # turn off compatibility with PHP4 when dealing with objects
  65.  
  66. php_flag zend.ze1_compatibility_mode Off
  67.  
  68. </IfModule>
  69.  
  70. <IfModule mod_security.c>
  71. ###########################################
  72. # disable POST processing to not break multiple image upload
  73.  
  74. SecFilterEngine Off
  75. SecFilterScanPOST Off
  76. </IfModule>
  77.  
  78. <IfModule mod_deflate.c>
  79.  
  80. ############################################
  81. ## enable apache served files compression
  82. ## http://developer.yahoo.com/performance/rules.html#gzip
  83.  
  84. # Insert filter on all content
  85. ###SetOutputFilter DEFLATE
  86. # Insert filter on selected content types only
  87. #AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css text/javascript
  88.  
  89. # Netscape 4.x has some problems...
  90. #BrowserMatch ^Mozilla/4 gzip-only-text/html
  91.  
  92. # Netscape 4.06-4.08 have some more problems
  93. #BrowserMatch ^Mozilla/4\.0[678] no-gzip
  94.  
  95. # MSIE masquerades as Netscape, but it is fine
  96. #BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
  97.  
  98. # Don't compress images
  99. #SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary
  100.  
  101. # Make sure proxies don't deliver the wrong content
  102. #Header append Vary User-Agent env=!dont-vary
  103.  
  104. </IfModule>
  105.  
  106. <IfModule mod_ssl.c>
  107.  
  108. ############################################
  109. ## make HTTPS env vars available for CGI mode
  110.  
  111. SSLOptions StdEnvVars
  112.  
  113. </IfModule>
  114.  
  115. <IfModule mod_rewrite.c>
  116.  
  117. ############################################
  118. ## enable rewrites
  119.  
  120. Options +FollowSymLinks
  121. RewriteEngine on
  122.  
  123. ############################################
  124. ## you can put here your magento root folder
  125. ## path relative to web root
  126.  
  127. RewriteBase /
  128.  
  129. ############################################
  130. ## uncomment next line to enable light API calls processing
  131.  
  132. # RewriteRule ^api/([a-z][0-9a-z_]+)/?$ api.php?type=$1 [QSA,L]
  133.  
  134. ############################################
  135. ## rewrite API2 calls to api.php (by now it is REST only)
  136.  
  137. RewriteRule ^api/rest api.php?type=rest [QSA,L]
  138.  
  139. ############################################
  140. ## workaround for HTTP authorization
  141. ## in CGI environment
  142.  
  143. RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
  144.  
  145. ############################################
  146. ## TRACE and TRACK HTTP methods disabled to prevent XSS attacks
  147.  
  148. RewriteCond %{REQUEST_METHOD} ^TRAC[EK]
  149. RewriteRule .* - [L,R=405]
  150.  
  151. ############################################
  152. ## redirect for mobile user agents
  153.  
  154. #RewriteCond %{REQUEST_URI} !^/mobiledirectoryhere/.*$
  155. #RewriteCond %{HTTP_USER_AGENT} "android|blackberry|ipad|iphone|ipod|iemobile|opera mobile|palmos|webos|googlebot-mobile" [NC]
  156. #RewriteRule ^(.*)$ /mobiledirectoryhere/ [L,R=302]
  157.  
  158. ############################################
  159. ## always send 404 on missing files in these folders
  160.  
  161. RewriteCond %{REQUEST_URI} !^/(media|skin|js)/
  162.  
  163. ############################################
  164. ## never rewrite for existing files, directories and links
  165.  
  166. RewriteCond %{REQUEST_FILENAME} !-f
  167. RewriteCond %{REQUEST_FILENAME} !-d
  168. RewriteCond %{REQUEST_FILENAME} !-l
  169.  
  170. ############################################
  171. ## rewrite everything else to index.php
  172.  
  173. RewriteRule .* index.php [L]
  174.  
  175. </IfModule>
  176.  
  177.  
  178. ############################################
  179. ## Prevent character encoding issues from server overrides
  180. ## If you still have problems, use the second line instead
  181.  
  182. AddDefaultCharset Off
  183. #AddDefaultCharset UTF-8
  184.  
  185. <IfModule mod_expires.c>
  186.  
  187. ############################################
  188. ## Add default Expires header
  189. ## http://developer.yahoo.com/performance/rules.html#expires
  190.  
  191. ExpiresDefault "access plus 1 year"
  192.  
  193. </IfModule>
  194.  
  195. ############################################
  196. ## By default allow all access
  197.  
  198. Order allow,deny
  199. Allow from all
  200.  
  201. ###########################################
  202. ## Deny access to release notes to prevent disclosure of the installed Magento version
  203.  
  204. <Files RELEASE_NOTES.txt>
  205. order allow,deny
  206. deny from all
  207. </Files>
  208.  
  209. ############################################
  210. ## If running in cluster environment, uncomment this
  211. ## http://developer.yahoo.com/performance/rules.html#etags
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement