httpbin - 协议调试工具
httpstatuses - 协议状态码查询
httpie - cURL-like tool for humans
Fiddler
wencan
V2EX  ›  HTTP

http url 中 /root 和 /root/ 相同吗?

  •  
  •   wencan · Oct 22, 2015 · 3872 views
    This topic created in 3856 days ago, the information mentioned may be changed or developed.

    https://www.v2ex.com/new 创作新主题
    https://www.v2ex.com/new/ 404

    https://golang.org/doc 会跳转到 https://golang.org/doc/

    下面两个是一样的
    https://github.com/wencan/docker-library
    https://github.com/wencan/docker-library/

    今天还发现, nginx location 执行精确匹配时,/root 和 /root/是不同的

    7 replies    2015-10-22 17:10:57 +08:00
    blacktulip
        1
    blacktulip  
       Oct 22, 2015
    google 搜 trailing slash in url
    Shieffan
        2
    Shieffan  
       Oct 22, 2015   ❤️ 1
    相不相同要看你服务端怎么处理,你可以定义 /root 跟 /root/为不同的业务逻辑,你也可以让 /root 301 到 /root/,你也可以 rewrite 掉结尾的 /
    wildfates
        3
    wildfates  
       Oct 22, 2015
    /root.txt

    /root/.txt

    这种是不是就明白了?

    带 /是文件夹,不带是文件
    imkodo
        4
    imkodo  
       Oct 22, 2015   ❤️ 1
    域名后面从"/"开始的字符串服务器是怎么处理的你永远都不知道
    wencan
        5
    wencan  
    OP
       Oct 22, 2015
    @wildfates 我也知道一个是文件,一个是文件夹
    但这是对传统的文件服务器而言的
    cevincheung
        6
    cevincheung  
       Oct 22, 2015
    URL 表示一个资源。
    /root 和 /root/ 代表是两个资源。
    xfspace
        7
    xfspace  
       Oct 22, 2015
    url rewrite
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   5949 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 69ms · UTC 02:53 · PVG 10:53 · LAX 19:53 · JFK 22:53
    ♥ Do have faith in what you're doing.