: How to set preferred domain with https in Google Webmaster Tools I have registered a website and bought an SSL certificate, installed it and did some mod_rewrite rules to have all my traffic
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 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, 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?
More posts by @Sue5673885
2 Comments
Sorted by latest first Latest Oldest Best
as @w3dk mention in the comments, I had to add a R=301 in my .htaccess file.
RewriteEngine On
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ %{SERVER_NAME}/ [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.
Google Webmaster Tools has no option to set HTTPS as the preferred version. Google takes this automatically from your canonical link tag.
<link rel="canonical" href="https://example.com/">
So whenever the Google spider sees this line in your head section, Google automatically indexes the HTTPS version of your site.
Nowadays, Google indexes HTTPS pages by default, if it is available.
Additional Tips: If you move your site from http to https, then edit your internal webpage, and link to https version of your site. It helps to recover in drop traffic. You can use Google Webmaster Tools to find out which page is linked from which webpages.
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.