【问题标题】:How to stop Google search from linking to https?如何阻止谷歌搜索链接到 https?
【发布时间】:2016-11-28 03:06:35
【问题描述】:

当我通过 Google 搜索结果找到我的网站时,它正在使用:

https://www.example.com

由于我还没有有效的 SSL 证书,所以浏览器中会出现警告 --

"Your connection is not private"

我希望 Google 使用 http://example.com 而不是 https 链接到我的网站。我的其他非 SSL 网络应用没有这个问题。

我可以采取哪些步骤来解决这个问题?

【问题讨论】:

  • 您如何想象这样的事情会起作用?谷歌正在进行搜索并提供带有 https 协议的链接。您无法阻止 Google 这样做。在过去的两三年里,Google 确实一直在推动 https,所以我不会指望事情会发生变化。
  • 我认为这可能是我的一些配置问题。为什么我的其他没有 SSL 证书的网站不会收到此警告?@MarsAtomic
  • 我很确定这是 Chrome 特有的问题。你试过其他浏览器吗?如果您的证书不正确,而不是没有证书,则应该会出现该消息。无论如何,我认为它与您的应用程序无关,当然也与编程无关,因此您已经超越了这里。

标签: ruby-on-rails ssl heroku dns search-engine


【解决方案1】:

仔细检查您没有在设置中强制使用 SSL

#config/environments/production.rb
# If this is set to true, change it to false
config.force_ssl = false

还要确保您没有使用 https:// 连接链接到任何外部资源,而是使用协议中性 // 代替。在我的一个使用 DataTables 的应用程序中查看 stylesheet_link_tag 行和来自这个 sn-p 的注释堆栈溢出问题

# views/layouts/application.html.haml
-# Include DataTables stylesheets
-# http://datatables.net
-# BUGFIX
-# Note the lack of a http: protocol definition to prevent force_ssl config setting
-# from preventing content loading
-# http://stackoverflow.com/questions/18121258/the-page-at-url-ran-insecure-content-from-url-in-chrome
= stylesheet_link_tag '//cdn.datatables.net/1.10.2/css/jquery.dataTables.min.css'
= javascript_include_tag '//cdn.datatables.net/1.10.2/js/jquery.dataTables.min.js'

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2012-08-19
    • 2017-08-01
    • 1970-01-01
    • 1970-01-01
    • 2012-06-22
    • 1970-01-01
    • 2015-07-27
    相关资源
    最近更新 更多