What is the name of this URL part?

2019-08-28 02:51发布

If I have a URL:

http://mysite.com/part1/page.aspx

What is the name of the part1 part in that URL?

标签: asp.net http url
3条回答
叼着烟拽天下
2楼-- · 2019-08-28 03:26

Justin is correct - it's one part of the path. Adding a reference to the URI RFC, for the pretty picture contained therein, which illustrates (in section 3) each part of an example URI:

  foo://example.com:8042/over/there?name=ferret#nose
  \_/   \______________/\_________/ \_________/ \__/
   |           |            |            |        |
scheme     authority       path        query   fragment

Further on, in the section devoted to the path:

A path consists of a sequence of path segments separated by a slash ("/") character. A path is always defined for a URI, though the defined path may be empty (zero length). Use of the slash character to indicate hierarchy is only required when a URI will be used as the context for relative references. For example, the URI has a path of "fred@example.com", whereas the URI has an empty path. (emphasis mine)

And so "path segment" might be the term you're looking for.

查看更多
疯言疯语
3楼-- · 2019-08-28 03:30

That would be the first part of the path. There's no term to describe that part alone.

查看更多
地球回转人心会变
4楼-- · 2019-08-28 03:38

I might possibly be name "the protocol"?

查看更多
登录 后发表回答