RewriteEngine On
RewriteCond %{HTTP_HOST} ^www\.(.*)
[NC]RewriteRule ^(.*)$
https://%1/$1 [r=301,L]RewriteCond %{HTTPS} off
RewriteCond %{HTTP:X-Forwarded-Proto} !https
RewriteRule ^(.*)$
https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
# If your opencart installation does not run on the main web folder make sure you folder it does run in ie. / becomes /shop/
RewriteBase /
RewriteRule ^sitemap.xml$ index.php?route=extension/feed/google_sitemap
[l]RewriteRule ^googlebase.xml$ index.php?route=extension/feed/google_base
RewriteRule ^system/storage/(.*) index.php?route=error/not_found
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][/l][/r]