HTML (English) 08 - සාමාන්‍යපෙළ තොරතුරු හා සන්නිවේදන තාක්ෂණය

HTML (English) 08

Location, Location, Location

Just specifying the host name is not enough to allow your documents to get delivered or retrieved, just as the street address ‘123main street’ is not enough information for the postal service to deliver that letter to your  sweetheart. More information is needed. On your letter you would add the city and state and, preferably, the ZIP code. You need to do the some thing when specifying the location part of a URL.

The location part of a URL begins with two slashes (//). These slashes are an important part of the URL; leaving them off causes the browser to interpret the URL in an entirely different way, which you’ll see shortly.  For now, be sure you include them in any URL you write or otherwise use. After these slashes, you use the machine name and then additional domain qualifiers, separated by periods. This is best seen by use of an example.

 

Suppose you wanted to retrieve a document that was located on the host machine named cool stuff, located  on the Big university  network. The location part of the URL would begin with the slashes (//), followed by the host name (cool stuff), the university network name (big), and finally the general domain name (edu). Each of  the domain name and host name portions would be separated from the others by periods, so that the fully qualified host name would be

// cool stuff. Big. Edu

 

What Do You Want?

Now that you’ve built a URL that specifies on what machine the file is located, you need to tell it, unambiguously, exactly which document you wish to retrieve. This is done by use of a file specifies. The file specifies follows the host name and is separated from it by a slash.

 

How do you write a file specifier? That can get a little complex, so let’s take it piece by piece. The file specifier can include a path – that is, an optional  series of directory names separated by slashes- followed by the file name. This is the simple case. In addition, m ost systems have special rules that map a file name given as part of a URL to a local file name. These rules are not standard from system to system and must be learned by the users of a system to use it effectively. For example, a common rule on UNLK systems is to allow a directory name of the form ~ jumbo as the first part of the URL’s file specifies. This is shorthand for a directory named public _html that is located within the home directory of the user jumbo. These sorts of unwritten rules make for more convenient system use for those who know the rules, but are confusing  to those  unfamiliar with the system that supports  them. Consult your system administrator to learn the rules of the system you use.  

 

Often the file specifier  is omitted, which causes a file designated by the administrator fo the web server to be loaded. Similarly, users often omit the file name portion of a file specifier  that points into their  public-html  directory. Again, in this case a designated file will  be loaded. Such a file is usually named index-html or index.htm, though the actual name is decided by the system administrator.