Structure of a URL


What Is the Structure of a URL?



The structure of a URL is defined by the URL specification, see Generally, a URL consists of 7 parts:

  • Protocol Name - Identifies the communication protocol through which this resource is made available, like "http://" or "ftp://".
  • Host Name - Identifies the computer host that manages this resource, like "", or "".
  • Port Number - Identifies the communication port where hosting computer is taking requests, like ":8080".
  • Path Name - Identifies the directory where the resource is located, like "/", or "/faq/".
  • File Name - Identifies the file name of the resource, like "index.html", or "xanimal18.jpg".
  • Bookmark - Identifies a bookmark within the target document, like "#narrow".
  • Query String - Provides parameters to the resource manager, like "?hl=en&q=xhtml".

If you have a URL, you can easily break it into parts. For example, "" can be broken into 7 parts like this:

  • "http://" - Protocol Name.
  • ""- Host Name.
  • ":8080" - Port Number.
  • "/faq/xhtml/" - Path Name.
  • "index.html" - File Name.
  • "#footer" - Bookmark.
  • "?q=test" - Query String.


HTML Hyper Links and URLs

⇒⇒HTML Tutorials

2017-07-07, 402👍, 0💬