23. Uniform Resource Locator

HTML Uniform Resource Locator

Uniform Resource Locator(URL)
URL Schemes
Using Links

Uniform Resource Locator

is used to address a document on the world wide web.
when you click on a link in HTML document, an underlying <a> tag points to a place on the web with an href attribute value.
<a href="lastpage.htm">last page</a>

The lastpage.htm link in the example is a link that is relative to the website that you are browsing, and your browser will construct a full web address to access the page

http://www.w3schools.com/html/lastpage.htm

A full web address follows these syntax rules:

scheme://host.domain:port/path/filename

the scheme is defining the type of internet service.
the most common type is http.

the domain is defining the internet domain name like w3schools.com

the host is defining the domine host.
if omitted, the defult host for http is www.

The :port is defining the port number at the host.
the port number is normally omitted.

the defult port number for http is:80.

the path is defining a path at the server.
if the path is omitted, te resource must be located at the root directory of the web site.

the filename is defining the name of a document.
the defult filename might be defult.asp, index.html, or something else depending on the setting of the web server.

URL Schemes

Schemes Access
file a file on your local PC
ftp a file on an FTP server
http a file on a world wide web server
gopher a file on a Gopher server
news a usenet newsgroup
telnet a telnet connection
WAIS a file on a WAIS server

Accessing a Newsgroup

<a href="news:alt.html">HTML Newsgroup</a>
creates  a link to a news directory

Downloading with FTP

<a href="ftp://www.w3schools.com/ftp/winzip.exe">downloadwinzip</a>
creates a FTP directory

Link to your mail system

<a href="mailto:someone@w3schools.com">someone@w3schools.com</a>

Using Links

<html>
<body>
<p><a href="news:alt.html">HTML Newsgroup</a></p>
<p><a href="ftp://www.w3schools.com/ftp/winzip.exe">Download Winzip</a></p>
<p><a href="mailto:someone@w3schools.com">someone@w3schools.com</a></p>
</body>
</html>

No comments:

My Favorite Books

  • C and Data Structures by Ashok N. kamthane
  • Web Technologies by A. A. Puntambekar
  • Learn HTML and CSS with W3Schools
  • Learn JavaScript and Ajax with W3Schools
  • HTML5 Black Book: Covers Css3, Javascript,XML, XHTML, Ajax, PHP And Jquery
  • HTML5 Application Development Fundamentals: MTA Exam 98-375
  • .NET 4.0 Programming 6-In-1, Black Book
  • SQL Server 2008 R2 Black Book
  • Asp.net 4.0 Projects Covers: net 3.5 And .net 4.0 Codes, Black Book
  • UNIX Shell Programming 1 Edition by Yashavant Kanetkar
  • UNIX and Shell Programming 1 Edition by Richard F. Gilberg, Behrouz A. Forouzan
  • Computer Networks by Andrew S. Tanenbaum
  • Multiple Choice questions in computer science by Timothy J Williams