Do web browsers always send a trailing slash after a domain name?

后端 未结 4 483
广开言路
广开言路 2020-11-29 08:36

Is there consistency and/or a standard on how browsers send a url to a host related to trailing slashes?

Meaning, if I type in http://example.com in the

4条回答
  •  孤城傲影
    2020-11-29 08:59

    As far as the protocol is concerned, http://example.com/something and http://example.com/something/ are quite different. Some servers might redirect you from one to the other if it is implemented in such a way.

    As for the pure domain names, it always sends a request ending with a slash. (The domain name itself is not included in the path section of an HTTP request, just as Greg Hewgill and the others wrote. It is, however, included in the headers.)

    You can check it with a tool like Fiddler or WireShark.

提交回复
热议问题