I just noticed this morning and I have never seen it before on any of my sites. When I was checking the ranking manually for a specific term. I found my site at #5, but right below it was the exact same listing of my site, except it is the https: version. I tried using a site:https://mysite.com search, but google only displays the non https version of my site in those listings. Has anyone had experience with this. I am concerned because this would obviously be seen as duplicate since the pages are identical in content. My thought for a solution was something like: <?PHP if ($_SERVER['SERVER_PORT'] == 80){ echo "<meta name=\"robots\" content=\"index,follow\" />"; } else { echo "<meta name=\"robots\" content=\"noindex,nofollow\" />"; }?> Code (markup): Any suggestions, thoughts?
I do something like that but instead of no-index,no-follow I give them a 301 and a header location redirect.
I was thinking about that, but I really dont care if the average user is browsing secure. I just don't want the secure pages indexed. Doesn't redirecting from secure to unsecure cause an error message? Is there any way to query google to display only secure pages from a site in its index?
#1) You may be right. I would test it first. I'm thinking that since you redirect before anything is displayed on the page, it might not throw the error. #2) Good question