Thanks a lot Hans, I will try to do it
If you have an SSL certificate enabled - which you really must have for e-commerce - then you need to ensure that any variation of your domain name will reach the secure, canonical version. There are basically 4 versions:
http://
https://
http://www
https://www.
I assume you want https and www. In which case add the following code to your .htaccess file:
RewriteEngine On
RewriteCond %{HTTPS} off [OR]
RewriteCond %{HTTP_HOST} !^www. [NC]
RewriteCond %{HTTP_HOST} ^(?:www.)?(.+)$ [NC]
RewriteRule ^ https://www.%1%{REQUEST_URI} [L,NE,R=301]
If you don’t want the www bit use this code:
RewriteEngine On
RewriteCond %{HTTPS} off [OR]
RewriteCond %{HTTP_HOST} ^www. [NC]
RewriteCond %{HTTP_HOST} ^(?:www.)?(.+)$ [NC]
RewriteRule ^ https://%1%{REQUEST_URI} [L,NE,R=301]
and me…
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.