I am trying to make our website secure with a SSL certificate which I couldn't get working. I used https://www.whynopadlock.com/ to determine i need to force HTTPS in the htaccess file.(my config.php has been updated in public and admin. Also I have enabled SSL in my opencart 2.2.0)
It tells me to add the following to my hcaccess
Code: Select all
RewriteEngine On
RewriteCond %{HTTP_HOST} trademax\.co\.nz [NC]
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://www.trademax.co.nz/$1 [R,L]
So i add it in here and it looks like this
Code: Select all
#Force non-www:
RewriteEngine On
RewriteCond %{HTTP_HOST} trademax\.co\.nz [NC]
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://www.trademax.co.nz/$1 [R,L]
RewriteCond %{HTTP_HOST} trademax\.co\.nz [NC]
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://www.trademax.co.nz/$1 [R,L]
RewriteCond %{REQUEST_URI} !^/[0-9]+\..+\.cpaneldcv$
RewriteCond %{REQUEST_URI} !^/[A-F0-9]{32}\.txt(?:\ Comodo\ DCV)?$
RewriteCond %{REQUEST_URI} !^/\.well-known/pki-validation/[A-F0-9]{32}\.txt(?:\ Comodo\ DCV)?$
RewriteCond %{REQUEST_URI} !^/\.well-known/cpanel-dcv/[0-9a-zA-Z_-]+$
RewriteCond %{REQUEST_URI} !^/\.well-known/pki-validation/(?:\ Ballot169)?
RewriteRule ^(.*)$ http://trademax.co.nz/$1 [L,R=301]
Thanks