问题原文
原帖链接 · NotGaeL · CC BY-SA 3.0
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?
已采纳解答
原帖链接 · Simon Hayter · CC BY-SA 3.0
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
摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。
