HTTPS is invalid and might prevent it from being indexed[Fixed]

Problem

HTTPS is invalid and might prevent it from being indexed
Serving a page over HTTPS helps protect your users’ security and privacy

If you are getting the above error in your webmaster, then you are at the right place to fix the issue.

Why is this issue happening

It might be Google feature update which is why you are getting this error. You are also provided by a help article by Google
It it being caused because your website is not redirecting to https forcefully.

Solutions

This is really easy and you can apply the quick fix to get rid of this error.

1) For WordPress Websites

You can install Really Simple SSL plugin and add a force https redirect.
If you don’t want to add the plugin, then you can also force redirect to https from the below code which works on WordPress and as well as PHP websites too

2) For WordPress websites and for other websites

You need to add a force redirect to https and your issue should be fixed.
Open your .htaccess file which is normally in folder public_html and paste the below code.

For non-www websites:

RewriteEngine On
RewriteCond %{HTTPS} off [OR]
RewriteCond %{HTTP_HOST} ^www\. [NC]
RewriteCond %{HTTP_HOST} ^(?:www\.)?(.+)$ [NC]
RewriteRule ^ https://%1%{REQUEST_URI} [L,NE,R=301]

For www websites:

RewriteEngine On
RewriteCond %{HTTPS} off [OR]
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteCond %{HTTP_HOST} ^(?:www\.)?(.+)$ [NC]
RewriteRule ^ https://www.%1%{REQUEST_URI} [L,NE,R=301]

Final Words

You can now scan your URL again and you should no longer see the error.
If you still have the problem, please free to comment and we’ll try to help you out.

Leave a Comment