Recommended Services
Amazon Web Services
LeanCloud
New Relic
ClearDB
DearTanker
V2EX  ›  云计算

CloudFlare 域名转发不支持根域名跳转 www 吗?

  •  
  •   DearTanker · Oct 3, 2017 · 8520 views
    This topic created in 3170 days ago, the information mentioned may be changed or developed.

    有谁成功的可以分享一下设置方法吗?

    试过 PageRule 里面

    • ***.com 301 到 https://www.***.com 不行。
    • http://***.com 301 到 https://www.***.com 不行。
    • **.com 301/ 到 https://www.***.com 不行。
    • http://**.com/ 301 到 https://www.***.com 不行。
    6 replies    2021-01-21 16:02:57 +08:00
    Devmingwang
        1
    Devmingwang  
       Oct 3, 2017
    你的姿势错误,正确举例如下:
    比方说我这里有个域名叫 51kly.net ,那么

    http://51kly.net 301 http://www.51kly.net
    hotbaidu
        2
    hotbaidu  
       Oct 6, 2017
    @Devmingwang 是的,而且配置应该写成
    http://51kly.net/* 301 http://www.51kly.net/$1
    如果有需要两个*分别对应$1 跟$2
    DearTanker
        3
    DearTanker  
    OP
       Oct 6, 2017
    @Devmingwang 你这个不是和我上面的第二个姿势一样吗?
    DearTanker
        4
    DearTanker  
    OP
       Apr 22, 2018   ❤️ 2
    我的天,终于搞定了,还要给根域名随便 A 一个 IP 以后,PageRule 才会生效的。
    ytlook
        5
    ytlook  
       Jan 18, 2021
    翻到楼主老帖子,配置成功,并更新一下我的注意事项:
    1 、如楼主说的需要为该域名先配置一个 A 类解析的 IP,可随便配置一个公网 IP ;
    2 、这条解析必须设置为“已代理”,否则单纯当 DNS 用就真的只是解析为上面配置的 IP 了。

    301/302 的实质是域名指向的服务器给了个转发域名的 HTTP 应答,已经不是 pure 的 DNS 解析了。
    DearTanker
        6
    DearTanker  
    OP
       Jan 21, 2021
    @ytlook #5 对的对的。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   3158 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 43ms · UTC 13:18 · PVG 21:18 · LAX 06:18 · JFK 09:18
    ♥ Do have faith in what you're doing.