问题原文
原帖链接 · BlackSky86 · CC BY-SA 3.0
I have registered a website and bought an SSL certificate, installed it and did some mod_rewrite rules to have all my traffic go to https://example.com. So all is working nicely from that perspective.
I also went to Google Search Console and added/verified all the www, non-www and https, https://www sites. But when I go to preferred domain, I don't see the option for https. So I just decided to go with the example.com one. Is there anything I need to do? Do I need to add 301 redirects? Or how do I check I did it right?
已采纳解答
原帖链接 · BlackSky86 · CC BY-SA 3.0
as @w3dk mention in the comments, I had to add a R=301 in my .htaccess file.
RewriteEngine On
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://%{SERVER_NAME}/$1 [R=301,L]
</IfModule>
I didn't try Goyllo's answer but I think it's a good one if you don't have access to the server.
摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。
