+2 votes
in Web & Google by (35.2k points)
edited by

Whenever I submit my web pages to Google for indexing from the google search console, it shows the error message: "HTTPS is invalid and might prevent it from being indexed". There is nothing wrong with the SSL on my website. I tested my website at SSL lab, and it returned zero error. Due to this error, it takes days for Google to index my pages, and once the page is indexed, the error disappears. 

How can I fix this error so that indexing is not delayed?

1 Answer

+2 votes
by (176k points)
selected by
 
Best answer

This problem started recently (in September 2022) after google's latest search algorithm update. Many webmasters are complaining about this error, and many might not have even noticed it. But, there is no help or update from google. If you look at google's support page, it does not make sense when the SSL lab test is not complaining about the certificate issue.

I was also getting this error for my pages on this website. Since I am redirecting HTTP to HTTPS using "301 redirect" on the server, I thought maybe google is considering HTTP and HTTPS as two different pages after their latest update. To solve this issue, I enabled HSTS (HTTP Strict Transport Security) on my server with a max-age of 1 year. Not sure if this is the right solution, but it worked for me. Now I do not see the error when I submit pages to google for indexing in the google search console.

If you are using the Nginx server, add the following line to the server config file:

add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always;

If you are using the Apache server, add the following line to the server config file:

Header always set Strict-Transport-Security "max-age=31536000; includeSubDomains"

Restart your server. In 2-3 days, Google will learn that your website serves only HTTPS pages and will stop showing the error.


...