: Google is indexing my site as HTTPS and HTTP I went to search my site to see how Google is indexing it and it is for some reason all jacked up. I am seeing some pages indexed as HTTPS
I went to search my site to see how Google is indexing it and it is for some reason all jacked up.
I am seeing some pages indexed as HTTPS and then the same pages as not. Also the meta description is jacked up on some of them but correct on others.
I have no clue why this is happening. Any tips?
More posts by @Nimeshi995
1 Comments
Sorted by latest first Latest Oldest Best
this happens, because of missed redirection from http to https: pages are available with both protocols. Create search console properties for both kinds, and then redirect all http urls to https, with something like, in PHP
<?php
if ($_SERVER["SERVER_PORT"] != 443) {
$redir = "Location: . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF'];
header($redir);
header("HTTP/1.1 301 Moved Permanently");
exit();
}
?>
or, for Apache
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) %{HTTP_HOST}%{REQUEST_URI} </IfModule>
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.