Figuring Out What URLs Are Made Of - dummies

Figuring Out What URLs Are Made Of

A URL (Uniform Resource Locator) is a standardized way of naming network resources, used for linking pages on the World Wide Web.

The first item in a URL, the letters that appear before the colon, is the scheme, which describes the way a browser can get to the resource. Although ten schemes are defined, the most common by far is HTTP, which stands for HyperText Transfer Protocol, the Web’s native transfer technique. (Don’t confuse HTTP, which is the way pages are sent over the Internet, with HTML, which is the system of formatting codes in Web pages.) HTTP is the language that your browser uses to request a Web page from the Web server on which it’s stored, and that the Web server uses to send you back the page you want to see.

Although the details of the rest of the URL depend on the scheme, most schemes look similar. Following the colon are two slashes (always forward slashes, never backslashes) and the name of the host computer on which the resource lives. Then comes another slash and a path, which gives the name of the resource on that host.

Web URLs allow a few other optional parts. They can include a port number, which specifies, roughly speaking, which of several programs running on that host should handle the request. The port number goes after a colon after the host name.

The standard http port number is 80, so if that’s the port you want (it usually is), you can leave it out. Finally, a Web URL can have a query part at the end, following a question mark.

When a URL has a query part, it tells the host computer more specifically what you want the page to display. (You rarely type query parts yourself — they’re often constructed for you from fill-in fields on Web pages.)

When you type a URL into your Web browser, you can leave out the http:// part because the browser adds it for you. Lazy typists, unite! When a Web address starts with www, you can usually leave that out, too.

Two other useful URL schemes are mailto and file. A mailto link is an e-mail address. Clicking a mailto URL runs your e-mail program and creates a new message addressed to the address in the link. The file URL specifies a file on your own computer. The URL looks like this:


The file URL specifies a file on your own computer. On a Windows computer, this line indicates a Web page stored in the file C:wwwindex.htm on your own computer. The colon turns into a vertical bar (because colons in URLs mean something else), and the backslashes turn into forward slashes. File URLs are useful mostly for looking at a Web page you just created and saved on your hard drive.