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]