Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # 1.To use URL Alias you need to be running apache with mod_rewrite enabled.
- # 2. In your opencart directory rename htaccess.txt to .htaccess.
- # For any support issues please visit: http://www.opencart.com
- Options +FollowSymlinks
- # Prevent Directoy listing
- Options -Indexes
- # Prevent Direct Access to files
- # <FilesMatch "(?i)((\.tpl|\.ini|\.log|(?<!robots)\.txt))">
- <FilesMatch "(?i)((\.tpl|\.ini|\.log))”>
- Order deny,allow
- Deny from all
- </FilesMatch>
- # SEO URL Settings
- RewriteEngine On
- # If your opencart installation does not run on the main web folder make sure you folder it does run in ie. / becomes /shop/
- #exclude https redirect
- RewriteCond %{HTTPS} on
- RewriteCond %{REQUEST_URI} semantic [NC]
- RewriteRule ^(.*)$ http://%{HTTP_HOST}/$1 [L,R=301]
- RewriteBase /
- RewriteRule ^sitemap.xml$ index.php?route=feed/google_sitemap [L]
- RewriteRule ^googlebase.xml$ index.php?route=feed/google_base [L]
- RewriteRule ^system/download/(.*) index.php?route=error/not_found [L]
- RewriteCond %{REQUEST_FILENAME} !-f
- RewriteCond %{REQUEST_FILENAME} !-d
- RewriteCond %{REQUEST_URI} !.*\.(ico|gif|jpg|jpeg|png|js|css)
- RewriteRule ^([^?]*) index.php?_route_=$1 [L,QSA]
- # Enable Gzip Compression
- AddOutputFilterByType DEFLATE text/text
- AddOutputFilterByType DEFLATE text/plain
- AddOutputFilterByType DEFLATE text/html
- AddOutputFilterByType DEFLATE text/xml
- AddOutputFilterByType DEFLATE text/css
- AddOutputFilterByType DEFLATE application/xml
- AddOutputFilterByType DEFLATE application/xhtml+xml
- AddOutputFilterByType DEFLATE application/rss+xml
- AddOutputFilterByType DEFLATE application/javascript
- AddOutputFilterByType DEFLATE application/x-javascript
- AddOutputFilterByType DEFLATE text/javascript
- AddOutputFilterByType DEFLATE application/vnd.ms-fontobject
- AddOutputFilterByType DEFLATE application/x-font
- AddOutputFilterByType DEFLATE application/x-font-opentype
- AddOutputFilterByType DEFLATE application/x-font-otf
- AddOutputFilterByType DEFLATE application/x-font-truetype
- AddOutputFilterByType DEFLATE application/x-font-ttf
- AddOutputFilterByType DEFLATE font/opentype
- AddOutputFilterByType DEFLATE font/otf
- AddOutputFilterByType DEFLATE font/ttf
- AddOutputFilterByType DEFLATE image/svg+xml
- AddOutputFilterByType DEFLATE image/x-icon
- # Remove Browser Bugs
- BrowserMatch ^Mozilla/4 gzip-only-text/html
- BrowserMatch ^Mozilla/4\.0[678] no-gzip
- BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
- Header append Vary User-Agent
- <IfModule mod_deflate.c>
- <FilesMatch "\.(js|css)$">
- SetOutputFilter DEFLATE
- </FilesMatch>
- </IfModule>
- # cache gif, jpg, and png files for one week
- <FilesMatch ".(gif|jpg|jpeg|png)$">
- Header set Cache-Control "max-age=604800"
- </FilesMatch>
- # Leverage Browser Caching
- <IfModule mod_expires.c>
- ExpiresActive On
- ExpiresByType image/jpg "access plus 1 week"
- ExpiresByType image/jpeg "access plus 1 week"
- ExpiresByType image/gif "access plus 1 week"
- ExpiresByType image/png "access plus 1 week"
- ExpiresByType text/css "access plus 1 week"
- ExpiresByType application/pdf "access plus 1 week"
- ExpiresByType text/x-javascript "access plus 1 week"
- ExpiresByType application/x-shockwave-flash "access plus 1 week"
- ExpiresByType image/x-icon "access plus 1 week"
- ExpiresDefault "access plus 1 week"
- </IfModule>
- <Files 403.shtml>
- order allow,deny
- allow from all
- </Files>
- <IfModule mod_headers.c>
- <FilesMatch "\.(ttf|ttc|otf|eot|woff|woff2|font.css|css|js)$">
- Header set Access-Control-Allow-Origin "*"
- </FilesMatch>
- </IfModule>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement