V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
dsg001
V2EX  ›  PHP

google.com 为什么会跳转到 google.com.hk

  •  
  •   dsg001 · Oct 15, 2016 · 16503 views
    This topic created in 3481 days ago, the information mentioned may be changed or developed.

    使用 php curl 打开 https://www.google.com/search?q=test ,两台办瓦工 vps ,相同代码,一台没问题,一台提示跳转 google.com.hk ,使用 httpbin.org/get 返回 header 完全相同;

    测试wget www.google.com,也是跳转

    --2016-10-15 05:09:36--  http://www.google.com/
    Resolving www.google.com... 172.217.4.164, 2607:f8b0:4007:801::2004
    Connecting to www.google.com|172.217.4.164|:80... connected.
    HTTP request sent, awaiting response... 200 OK
    
    *************************************
    Resolving www.google.com... 172.217.4.164, 2607:f8b0:4007:807::2004
    Connecting to www.google.com|172.217.4.164|:80... connected.
    HTTP request sent, awaiting response... 302 Found
    Location: http://www.google.com.hk/url?sa=p&hl=zh-CN&pref=hkredirect&pval=yes&q=                      http://www.google.com.hk/%3Fgws_rd%3Dcr&ust=1476522486997476&usg=AFQjCNGyugZlxwQ                      -bicc0iO0Wz-FFANU0A [following]
    --2016-10-15 05:07:37--  http://www.google.com.hk/url?sa=p&hl=zh-CN&pref=hkredir                      ect&pval=yes&q=http://www.google.com.hk/%3Fgws_rd%3Dcr&ust=1476522486997476&usg=                      AFQjCNGyugZlxwQ-bicc0iO0Wz-FFANU0A
    Resolving www.google.com.hk... 172.217.5.67, 2607:f8b0:4007:801::2003
    Connecting to www.google.com.hk|172.217.5.67|:80... connected.
    HTTP request sent, awaiting response... 302 Found
    Location: http://www.google.com.hk/?gws_rd=cr [following]
    --2016-10-15 05:07:37--  http://www.google.com.hk/?gws_rd=cr
    Reusing existing connection to www.google.com.hk:80.
    HTTP request sent, awaiting response... 200 OK
    
    Supplement 1  ·  Oct 16, 2016
    申诉没反应,使用 ncr 勉强解决,先访问 google.com/ncr 获取 cookie ,之后带 cookie 访问 google
    28 replies    2016-10-25 17:12:05 +08:00
    102400
        1
    102400  
       Oct 15, 2016
    UA 改下看看?
    dsg001
        2
    dsg001  
    OP
       Oct 15, 2016
    @102400 wget 默认 ua ,一个跳,一个不跳
    mytsing520
        3
    mytsing520  
    PRO
       Oct 15, 2016
    hshpy
        4
    hshpy  
       Oct 15, 2016   ❤️ 5
    www.google.com/ncr 打开一次,退出浏览器,以后 www.goole.com 就是国际版,不会跳 hk
    mytsing520
        5
    mytsing520  
    PRO
       Oct 15, 2016
    @hshpy Goole ?
    TriiHsia
        6
    TriiHsia  
       Oct 15, 2016 via iPhone   ❤️ 1
    https://loli.am/posts/note-googlecrt 我写的一篇博文,可以参考一下。不过基本就是楼上说的方法。
    hshpy
        7
    hshpy  
       Oct 15, 2016
    @mytsing520 google😅
    jokerlee
        8
    jokerlee  
       Oct 15, 2016
    应该是根据 IP 自动跳转
    HmyBmny
        9
    HmyBmny  
       Oct 15, 2016
    根据你的 ip 重定向很正常啊。。。
    liuyanjun0826
        10
    liuyanjun0826  
       Oct 15, 2016 via iPhone
    可能是 cookie 的问题
    finalspeed
        11
    finalspeed  
       Oct 15, 2016 via Android
    我也有两个搬瓦工,一个在洛机山,一个在凤凰城,使用洛机山的 SS ,打开 Google 首页不跳转,使用凤凰城的 SS ,打开 Google 首页就会跳转到 HK ,同一个本地环境,只是切换一下 SS 服务器,为什么?
    raptor
        12
    raptor  
       Oct 15, 2016
    跳 HK 的那个莫非装了代理?
    tghgffdgd
        13
    tghgffdgd  
       Oct 15, 2016 via Android
    ip 被 Google 当作中国 ip 了,你可以上 Google 搜索任意关键词,下面会提示你当前位置
    Adven
        14
    Adven  
       Oct 15, 2016
    先访问一次 www.google.com/ncr ,之后就不会跳了!
    mytsing520
        15
    mytsing520  
    PRO
       Oct 15, 2016
    @HmyBmny 根据本地语言和 IP 调整的
    dtfm
        16
    dtfm  
       Oct 15, 2016
    是 Google 内置 IP 库识别错误,在阿里云新加坡上这种现象非常常见

    https://support.google.com/websearch/answer/873?hl=zh-Hans

    可以去这个网页申诉 , Google 为数不多的客服服务啊

    skyeycirno
        17
    skyeycirno  
       Oct 16, 2016 via iPhone
    你的 ip 识别问题而已… Azure 的香港 ip 是广播过去的,打开 google 默认跳到印尼的谷歌
    bombless
        18
    bombless  
       Oct 16, 2016 via Android
    是不是可以改 accept 头
    techmoe
        19
    techmoe  
       Oct 16, 2016 via Android
    那个是根据浏览器区域设置跳的吧
    解决方法域名后加 ncr
    linux40
        20
    linux40  
       Oct 16, 2016 via Android
    学过网络的 DNS 协议没有
    skylancer
        21
    skylancer  
       Oct 16, 2016 via Android
    Google 的 IP 库挺坑的,习惯就好
    dsg001
        22
    dsg001  
    OP
       Oct 16, 2016
    貌似真是 google 的坑, dns 、 ua 、 cookie 、 accept 都无关,直接在 vps 打开都是跳转,怀疑是办瓦工的 ip 被国内翻墙用的太多,自动识别成中国 ip 了
    skyeycirno
        23
    skyeycirno  
       Oct 16, 2016 via iPhone
    @dsg001 搬瓦工就是国人炒起来的,被墙的差不多了吧
    sumuu
        24
    sumuu  
       Oct 16, 2016
    @TriiHsia 修改 Preference 现在好像行不通了,今天上午修改了很多次都自动修改回来.

    Chrome Version: 54.0.2840.59 (64-bit)
    OS: Ubuntu 16.04 LTS

    后面直接修改了默认搜索:

    https://www.google.com/search?q=%s&{google:RLZ}{google:originalQueryForSuggestion}{google:assistedQueryStats}{google:searchFieldtrialParameter}{google:iOSSearchLanguage}{google:searchClient}{google:sourceId}{google:instantExtendedEnabledParameter}{google:contextualSearchVersion}ie={inputEncoding}
    imswing
        25
    imswing  
       Oct 17, 2016
    dsg001
        26
    dsg001  
    OP
       Oct 17, 2016
    @skyeycirno 公用难说,自用基本不会墙
    zuotech
        27
    zuotech  
       Oct 25, 2016
    我的更奇怪, chrome 直接搜索给我跳到 https://www.google.com.ph/~~~ 在设置里改搜索引擎都没用
    dsg001
        28
    dsg001  
    OP
       Oct 25, 2016
    @zuotech 安装#16 尝试申诉吧,不管基本没用
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   4032 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 67ms · UTC 04:17 · PVG 12:17 · LAX 21:17 · JFK 00:17
    ♥ Do have faith in what you're doing.