How to move a woocommerace site over from http to

2019-03-03 09:28发布

问题:

Ive recently installed a SSL on to my website and now I have duplicate content at http and https. Im running wordpress with woocommerace and I want to whole site to just run https. How to I go about changing this to only show https content. Im guessing its related to the .htaccess file with a redirect but im not sure what.

回答1:

This worked for me...

RewriteCond %{HTTPS} off 
RewriteCond %{HTTP_HOST} ^(?:www\.)?(.*)$ [NC]
RewriteRule (.*) https://%1%{REQUEST_URI} [L,R=301]