Home  >  Article  >  Backend Development  >  What is the difference between the following two URLs?

What is the difference between the following two URLs?

WBOY
WBOYOriginal
2016-08-04 09:22:101209browse

http://117.80.169.239:1234/api/
http://117.80.169.239:1234//api/ Why sometimes two slashes can be accessed, sometimes not

Reply content:

http://117.80.169.239:1234/api/
http://117.80.169.239:1234//api/ Why sometimes two slashes can be accessed, sometimes not

Not the same, PATH_INFO is different, two different addresses are requested.

In PHP and static resources, they will be mapped to the file directory by default. For the file directories / and //, it can be understood that they are consistent at the beginning, so they can all be accessed.

But from the perspective of the HTTP protocol, one is GET /api/ and the other is GET //api/, which are two different addresses.

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn