2.13.4.10. Стандартний .htaccess для OpenCart

Вміст стандартного .htaccess для OpenCart (GitHub):

  1. # 1.To use URL Alias you need to be running apache with mod_rewrite enabled.
  2.  
  3. # 2. In your opencart directory rename htaccess.txt to .htaccess.
  4.  
  5. # For any support issues please visit: http://www.opencart.com
  6.  
  7. Options +SymLinksIfOwnerMatch
  8.  
  9. # Prevent Directory listing
  10. Options -Indexes
  11.  
  12. # Prevent Direct Access to files
  13. <FilesMatch "(?i)((\.tpl|\.twig|\.ini|\.log|(?<!robots)\.txt))">
  14. Require all denied
  15. ## For apache 2.2 and older, replace "Require all denied" with these two lines :
  16. # Order deny,allow
  17. # Deny from all
  18. </FilesMatch>
  19.  
  20. # SEO URL Settings
  21. RewriteEngine On
  22. # If your opencart installation does not run on the main web folder make sure you folder it does run in ie. / becomes /shop/
  23.  
  24. RewriteBase /
  25. RewriteRule ^system/storage/(.*) index.php?route=error/not_found [L]
  26. RewriteCond %{REQUEST_FILENAME} !-f
  27. RewriteCond %{REQUEST_FILENAME} !-d
  28. RewriteCond %{REQUEST_URI} !.*\.(ico|gif|jpg|jpeg|png|webp|js|css|svg)
  29. RewriteRule ^([^?]*) index.php?_route_=$1 [L,QSA]
  30.  
  31. #ErrorDocument 400 /index.php?route=error/not_found
  32. #ErrorDocument 401 /index.php?route=error/permission
  33. #ErrorDocument 403 /index.php?route=error/not_found
  34. #ErrorDocument 404 /index.php?route=error/not_found
  35. #ErrorDocument 500 /index.php?route=error/not_found
  36. #ErrorDocument 503 /index.php?route=error/not_found
  37.  
  38. ### Additional Settings that may need to be enabled for some servers
  39. ### Uncomment the commands by removing the # sign in front of it.
  40. ### If you get an "Internal Server Error 500" after enabling any of the following settings, restore the # as this means your host doesn't allow that.
  41.  
  42. # 1. If your cart only allows you to add one item at a time, it is possible register_globals is on. This may work to disable it:
  43. # php_flag register_globals off
  44.  
  45. # 2. If your cart has magic quotes enabled, This may work to disable it:
  46. # php_flag magic_quotes_gpc Off
  47.  
  48. # 3. Set max upload file size. Most hosts will limit this and not allow it to be overridden but you can try
  49. # php_value upload_max_filesize 999M
  50.  
  51. # 4. set max post size. uncomment this line if you have a lot of product options or are getting errors where forms are not saving all fields
  52. # php_value post_max_size 999M
  53.  
  54. # 5. set max time script can take. uncomment this line if you have a lot of product options or are getting errors where forms are not saving all fields
  55. # php_value max_execution_time 200
  56.  
  57. # 6. set max time for input to be recieved. Uncomment this line if you have a lot of product options or are getting errors where forms are not saving all fields
  58. # php_value max_input_time 200
  59.  
  60. # 7. disable open_basedir limitations
  61. # php_admin_value open_basedir none

Директива в рядку 7 змінена для сумісності з нашим хостингом.

Зміст