2

My web requests a client certificate when you connect through https.

I want the certificate pop up dialog to show only through the login screen.

This is easy when all the links you see on the page are http, except from the ones pointing out to the login page.

Google is indexing all pages as https as the authoritative URLs, so mostly I just see https results.

How can I tell Google to stop indexing https instead of http?

How can I tell CSE to show http results instead of https?

4
  • 1
    You need to use canonical links that use HTTP:// and you need to ensure that your not forcing HTTPS:// i.e a redirect from http:// to https://, as Google will only index the page after the redirect, not the one doing the redirect. May 25 '16 at 18:57
  • People forget that CSE is Google and not necessarily a separate thing. If it works in regular Google search, it should be exactly the same in CSE. That is the theory anyway.
    – closetnoc
    May 26 '16 at 0:10
  • @Simon Hayter Thanks for the advice. I am not forcing https. Canonical links are a ton of work. I cannot use that solution on static pages. Loading a static page using https should show https links and the same on http should display all links http. Unless I harcode http and avoid relative links and then do some weird javascript foo on page loading on https I don't solve the problem. I will go with hacking the cse results page, replacing https links with http links. It is risky because it can break anytime, but it will work and it will be easier than patching my whole code base.
    – NotGaeL
    May 27 '16 at 8:24
  • @closetnoc yeah, solving the general google search indexing problem would solve the cse results problem too. I don't care that much about regular google search results, but a generic solution to avoid indexing https would be much better that one that just tells cse to filter https results. Do you know about one?
    – NotGaeL
    May 27 '16 at 8:26
2

Nowadays Google prefers to index HTTPS:// when given the option of both SSL and non-SSL. To avoid the HTTPS being indexed, but accessible to users you can select one of the options below.

Canonical Links

By far the best solution is to use canonical links, this will tell Google the preferred URL for both their crawler and users.

Header No Index

Sometimes using canonical links is not always practical when dealing with static websites, this problem can be easily tackled by using a noindex header response on all pages that use HTTPS://, a typical example of how to setup no index in the .htaccess file

  • Header set X-Robots-Tag noindex env=HTTPS

Redirect SSL Robots

Since Google treats SSL as a separate site, its possible to have two robot files, one for SSL, one for non-SSL, obviously in the SSL you deny access by using something like this:

RewriteCond %{HTTPS} on 
RewriteRule ^robots\.txt$ robots-ssl.txt
2
  • I agree canonical links is the best, but both no index header and robots.txt are easier to implement on this case. Thank you very much! :-)
    – NotGaeL
    May 28 '16 at 8:26
  • I tried the robots.txt solution but it's been a few days and I still see no changes. What can I do about it? I am currently using no 301 redirect code (https://)mydomain/robots.txt shows one version and (http://)mydomain/robots.txt shows the other. I've seen no reindeixing yet: All results still are https.
    – NotGaeL
    Jun 6 '16 at 8:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.