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

XHTML Tutorial - Default Protocol and Port Number of a URL

By: FYIcenter.com

(Continued from previous topic...)

What Happens If Protocol or Port Number Is Missing in a URL?

From a syntax point of view, all URL parts are optional. If some parts are not included in a URL, the browser and the hosting computer will provide default values. Here are some rules about the protocol name, host name, and port number:

1. If the protocol name part is missing, but the host name part is given, "http://" will be used as the default value. The following URLs are identical:

  dev.fyicenter.com/faq/xhtml/
  http://dev.fyicenter.com/faq/xhtml/

2. If the port number part is missing, but the host name part is given, the default port number that matches the protocol name will be used. The following URLs are identical:

  dev.fyicenter.com/faq/xhtml/
  dev.fyicenter.com:80/faq/xhtml/
  http://dev.fyicenter.com/faq/xhtml/
  http://dev.fyicenter.com:80/faq/xhtml/

3. If the port number part is given, the host name part must be specified. The following URLs are invalid:

  http://:8080/
  :80

(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:

More...