Advertisement
Makis77

opencart 2x htaccess for excluding https

Mar 5th, 2019
152
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.47 KB | None | 0 0
  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 +FollowSymlinks
  8.  
  9. # Prevent Directoy listing
  10. Options -Indexes
  11.  
  12. # Prevent Direct Access to files
  13. # <FilesMatch "(?i)((\.tpl|\.ini|\.log|(?<!robots)\.txt))">
  14. <FilesMatch "(?i)((\.tpl|\.ini|\.log))”>
  15. Order deny,allow
  16. Deny from all
  17. </FilesMatch>
  18.  
  19. # SEO URL Settings
  20. RewriteEngine On
  21. # If your opencart installation does not run on the main web folder make sure you folder it does run in ie. / becomes /shop/
  22.  
  23. #exclude https redirect
  24. RewriteCond %{HTTPS} on
  25. RewriteCond %{REQUEST_URI} semantic [NC]
  26. RewriteRule ^(.*)$ http://%{HTTP_HOST}/$1 [L,R=301]
  27.  
  28. RewriteBase /
  29. RewriteRule ^sitemap.xml$ index.php?route=feed/google_sitemap [L]
  30. RewriteRule ^googlebase.xml$ index.php?route=feed/google_base [L]
  31. RewriteRule ^system/download/(.*) index.php?route=error/not_found [L]
  32. RewriteCond %{REQUEST_FILENAME} !-f
  33. RewriteCond %{REQUEST_FILENAME} !-d
  34. RewriteCond %{REQUEST_URI} !.*\.(ico|gif|jpg|jpeg|png|js|css)
  35. RewriteRule ^([^?]*) index.php?_route_=$1 [L,QSA]
  36.  
  37. # Enable Gzip Compression
  38. AddOutputFilterByType DEFLATE text/text
  39. AddOutputFilterByType DEFLATE text/plain
  40. AddOutputFilterByType DEFLATE text/html
  41. AddOutputFilterByType DEFLATE text/xml
  42. AddOutputFilterByType DEFLATE text/css
  43. AddOutputFilterByType DEFLATE application/xml
  44. AddOutputFilterByType DEFLATE application/xhtml+xml
  45. AddOutputFilterByType DEFLATE application/rss+xml
  46. AddOutputFilterByType DEFLATE application/javascript
  47. AddOutputFilterByType DEFLATE application/x-javascript
  48. AddOutputFilterByType DEFLATE text/javascript
  49. AddOutputFilterByType DEFLATE application/vnd.ms-fontobject
  50. AddOutputFilterByType DEFLATE application/x-font
  51. AddOutputFilterByType DEFLATE application/x-font-opentype
  52. AddOutputFilterByType DEFLATE application/x-font-otf
  53. AddOutputFilterByType DEFLATE application/x-font-truetype
  54. AddOutputFilterByType DEFLATE application/x-font-ttf
  55. AddOutputFilterByType DEFLATE font/opentype
  56. AddOutputFilterByType DEFLATE font/otf
  57. AddOutputFilterByType DEFLATE font/ttf
  58. AddOutputFilterByType DEFLATE image/svg+xml
  59. AddOutputFilterByType DEFLATE image/x-icon
  60.  
  61. # Remove Browser Bugs
  62. BrowserMatch ^Mozilla/4 gzip-only-text/html
  63. BrowserMatch ^Mozilla/4\.0[678] no-gzip
  64. BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
  65. Header append Vary User-Agent
  66.  
  67. <IfModule mod_deflate.c>
  68. <FilesMatch "\.(js|css)$">
  69. SetOutputFilter DEFLATE
  70. </FilesMatch>
  71. </IfModule>
  72.  
  73. # cache gif, jpg, and png files for one week
  74. <FilesMatch ".(gif|jpg|jpeg|png)$">
  75. Header set Cache-Control "max-age=604800"
  76. </FilesMatch>
  77.  
  78. # Leverage Browser Caching
  79. <IfModule mod_expires.c>
  80. ExpiresActive On
  81. ExpiresByType image/jpg "access plus 1 week"
  82. ExpiresByType image/jpeg "access plus 1 week"
  83. ExpiresByType image/gif "access plus 1 week"
  84. ExpiresByType image/png "access plus 1 week"
  85. ExpiresByType text/css "access plus 1 week"
  86. ExpiresByType application/pdf "access plus 1 week"
  87. ExpiresByType text/x-javascript "access plus 1 week"
  88. ExpiresByType application/x-shockwave-flash "access plus 1 week"
  89. ExpiresByType image/x-icon "access plus 1 week"
  90. ExpiresDefault "access plus 1 week"
  91. </IfModule>
  92.  
  93. <Files 403.shtml>
  94. order allow,deny
  95. allow from all
  96. </Files>
  97.  
  98. <IfModule mod_headers.c>
  99. <FilesMatch "\.(ttf|ttc|otf|eot|woff|woff2|font.css|css|js)$">
  100. Header set Access-Control-Allow-Origin "*"
  101. </FilesMatch>
  102. </IfModule>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement