4

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?

  • Presumably the "mod_rewrite rules" you added already included the necessary "301 redirects"? Setting example.com as the preferred domain if you are serving the bare domain is the correct thing to do. TBH I don't think there is anything more you can do in this respect. Include HTTPS in your sitemap etc. – MrWhite Jan 22 '16 at 9:48
  • I don't think I have the 301 in my .htaccess file. I have this RewriteEngine On RewriteCond %{SERVER_PORT} 80 RewriteRule ^(.*)$ https://%{SERVER_NAME}/$1 [R,L] </IfModule> – BlackSky86 Jan 25 '16 at 21:00
  • That's a 302 (temporary) redirect. Just change the R flag to R=301 to make it permanent. ie. [R=301,L]. – MrWhite Jan 25 '16 at 21:07
3

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.

  • Here is what I don't understand, I was able to verify all my domains(e.i www, https, etc) on google webmaster tools. However, I only have access to the https version on my wordpress backend. Can I just use canonical example you used, even thought it will be put on the https page? – BlackSky86 Jan 25 '16 at 21:17
  • You said about preferred domain i.e. you want to display https version in google search result. And yes, you are true, canonical link tag helps when you have not access to server side, but if you already redirect 301 from http to https version, then google spider will also redirect and crawl that page, and index your https version of your site. Hope your all internal links point to https :) – Goyllo Jan 26 '16 at 5:40
  • Just to clarify, in order to be able to specify the HTTPS URL in the canonical tag on the non-HTTPS site then the HTTPS version of the site must be verified by the same owner in Google Search Console (formerly Google Webmaster Tools). – MrWhite Jan 26 '16 at 7:57
1

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.