hosting:cms:opencart:htaccess

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: https://www.opencart.com
  6.  
  7. Options +SymLinksIfOwnerMatch
  8.  
  9. # Prevent Directoy 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.  
  23. # If your opencart installation does not run on the main web folder make sure you folder it does run in ie. / becomes /shop/
  24. RewriteBase /
  25. RewriteRule ^sitemap.xml$ index.php?route=extension/feed/google_sitemap [L]
  26. RewriteRule ^googlebase.xml$ index.php?route=extension/feed/google_base [L]
  27. RewriteRule ^system/storage/(.*) index.php?route=error/not_found [L]
  28. RewriteCond %{REQUEST_FILENAME} !-f
  29. RewriteCond %{REQUEST_FILENAME} !-d
  30. RewriteCond %{REQUEST_URI} !.*\.(ico|gif|jpg|jpeg|png|js|css)
  31. RewriteRule ^([^?]*) index.php?_route_=$1 [L,QSA]
  32.  
  33. ### Additional Settings that may need to be enabled for some servers
  34. ### Uncomment the commands by removing the # sign in front of it.
  35. ### 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.
  36.  
  37. # 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:
  38. # php_flag register_globals off
  39.  
  40. # 2. If your cart has magic quotes enabled, This may work to disable it:
  41. # php_flag magic_quotes_gpc Off
  42.  
  43. # 3. Set max upload file size. Most hosts will limit this and not allow it to be overridden but you can try
  44. # php_value upload_max_filesize 999M
  45.  
  46. # 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
  47. # php_value post_max_size 999M
  48.  
  49. # 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
  50. # php_value max_execution_time 200
  51.  
  52. # 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
  53. # php_value max_input_time 200
  54.  
  55. # 7. disable open_basedir limitations
  56. # php_admin_value open_basedir none

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

  • hosting/cms/opencart/htaccess.txt
  • Последние изменения: 2019/08/29 12:06
  • — karlov