Microsoft IIS 6.0Administrator's Consultant
|
To retrieve files from IIS servers, clients must know three things: the server’s address, where on the server the file is located, and which protocol to use to access and retrieve the file. Normally, this information is specified as a URL. URLs provide a uniform way of identifying resources that are available using IPs. The basic mechanism that makes URLs so versatile is their standard naming scheme.
URL schemes name the protocol the client will use to access and transfer the file. Clients use the name of the protocol to determine the format for the information that follows the protocol name. The protocol name is generally followed by a colon and two forward slashes. The information after the double slash marks follows a format that depends on the protocol type referenced in the URL. Here are two general formats:
protocol://hostname:port/path_to_resource
protocol://username:password@hostname:port/path_to_resource
Host name information used in URLs identifies the address to a host and is broken down into two or more parts separated by periods. The periods are used to separate domain information from the host name. Common domain names for Web servers begin with www, such as www.microsoft.com, which identifies the Microsoft WWW server in the commercial domain. Domains you can specify in your URLs include:
-
com Commercial sites
-
edu Education sites
-
gov Nonmilitary government sites
-
mil Military sites
-
net Network sites
-
org Organizational sites
Port information used in URLs identifies the port number to be used for the connection. Generally, you don't have to specify port numbers in your URLs unless the connection will be made to a port other than the default. As shown in Table 2-1, port 80 is the default port for HTTP. If you request a URL on a server using the URL http://www.microsoft.com/docs/my-yoyo.htm, port 80 is assumed to be the default port value. On the other hand, if you wanted to make a connection to port 8080, you’d need to type in the port value, such as http://www.microsoft.com:8080/docs/my-yoyo.htm.
Port values that fall between zero and 1023, referred to as well-known ports, are reserved for specific data type uses on the Internet. Port values between 1024 and 49151 are considered registered ports, and those between 49152 and 65535 are considered dynamic ports.
Protocol | Default Port |
---|---|
FTP | 21 |
SMTP | 25 |
HTTP | 80 |
NNTP | 119 |
The final part of a URL is the path to the resource. This path generally follows the directory structure from the server’s home directory to the resource specified in the URL.
URLs for FTP can also contain a user name and password. User name and password information allow users to log in to an FTP server using a specific user account. For example, the following URL establishes a connection to the Microsoft FTP server and logs on using a named account: ftp://sysadmin:rad$4@ftp.microsoft.com/public/download.doc.
In this instance, the account logon is sysadmin, the password is rad$4, the server is ftp.microsoft.com, and the requested resource is public/download.doc.
If a connection is made to an FTP server without specifying the user name and password, you can configure the server to assume that the user wants to establish an anonymous session. In this case the following default values are assumed: anonymous for user name and the user’s e-mail address as the password.
URLs can use uppercase and lowercase letters, the numerals 0-9, and a few special characters, including:
-
Asterisks (*)
-
Dollar signs ($)
-
Exclamation points (!)
-
Hyphens (-)
-
Parentheses (left and right)
-
Periods (.)
-
Plus signs (+)
-
Single quotation marks (‘)
-
Underscores (_)
You’re limited to these characters because other characters used in URLs have specific meanings, as shown in Table 2-2.
Character | Meaning |
---|---|
: | The colon is a separator that separates protocol from the rest of the URL scheme; separates host name from the port number; and separates user name from the password. |
// | The double slash marks indicate that the protocol uses the format defined by the Common Internet Scheme Syntax (see RFC 1738 for more information). |
/ | The slash is a separator and is used to separate the path from host name and port. The slash is also used to denote the directory path to the resource named in the URL. |
~ | The tilde is generally used at the beginning of the path to indicate that the resource is in the specified user’s public Hypertext Markup Language (HTML) directory. |
% | Identifies an escape code. Escape codes are used to specify special characters in URLs that otherwise have a special meaning or aren’t allowed. |
@ | The at symbol is used to separate user name and/or password information from the host name in the URL. |
? | The question mark is used in the URL path to specify the beginning of a query string. Query strings are passed to Common Gateway Interface (CGI) scripts. All the information following the question mark is data the user submitted and isn’t interpreted as part of the file path. |
+ | The plus sign is used in query strings as a placeholder between words. Instead of using spaces to separate words that the user has entered in the query, the browser substitutes the plus sign. |
= | The equal sign is used in query strings to separate the key assigned by the publisher from the value entered by the user. |
& | The ampersand is used in query strings to separate multiple sets of keys and values. |
^ | The caret is reserved for future use. |
{} | Braces are reserved for future use. |
[] | Brackets are reserved for future use. |
To make URLs even more versatile, you can use escape codes to specify characters in URLs that are either reserved or otherwise not allowed. Escape codes have two components: a percent sign and a numeric value. The percent sign identifies the start of an escape code. The number following the percent sign identifies the character being escaped. The escape code for a space is a percent sign followed by the number 20 (%20). You could use this escape code in a URL such as this one:
http://www.microsoft.com/docs/my%20party%20hat.htm
|