Home >> FAQs/Tutorials >> XHTML Tutorials and Tips >> Index

XHTML Tutorial - Structure of a URL

By: FYIcenter.com

(Continued from previous topic...)

What Is the Structure of a URL?

The structure of a URL is defined by the URL specification, see http://www.ietf.org/rfc/rfc2396.txt. 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 "www.w3.org", or "dev.fyicenter.com".
  • 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, "http://www.fyicenter.com:8080/faq/xhtml/index.html#footer?q=test" can be broken into 7 parts like this:

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

(Continued on next topic...)

  1. What Are Hyper Links?
  2. What Is an Anchor "a" Tag/Element?
  3. How To Define a Hyper Link?
  4. How To Define a Bookmark?
  5. What Is a URL?
  6. What Is the Structure of a URL?
  7. What Happens If Protocol or Port Number Is Missing in a URL?
  8. What Happens If a URL Starts with Path or File name?
  9. What Is a Relative Path Name?
  10. What Happens If File Name is Missing in a URL?
  11. How To Build Hyper Link Indexes within the Same Document?
  12. What Happens If a Hyper Link Points to an Image?
  13. What Happens If a Hyper Link Points to a Music File?
  14. What Happens If a Hyper Link Points to a PDF File?
  15. What Happens If a Hyper Link Points to a ZIP File?
  16. How To Create A Link to Open a Document in a New Window?

Selected Developer Jobs: