Mobile app version of vmapp.org
Login or Join
Nimeshi995

: 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

@Nimeshi995

Posted in: #GoogleSearch #GoogleSearchConsole #Indexing #MetaDescription

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?

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Nimeshi995

1 Comments

Sorted by latest first Latest Oldest Best

 

@Vandalay111

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>

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme