A URL (Uniform Resource Locator) is a form of URI and is a standardized naming convention for addressing documents accessible over the Internet or Intranet. An example of a URL is http://www.computerhope.com, which is the URL for the Computer Hope website.
Overview of a URL
Below is additional information about each of the sections of the http URL for this page.
Next, www. that stands for World Wide Web, is used to distinguish the content. This portion of the URL is not required, and many times can be left out. For example, typing "http://computerhope.com" would still get you to the Computer Hope web page. This portion of the address can also be substituted for an important sub page known as a subdomain. For example, http://support.microsoft.com is the support section of Microsoft's page.
Next, computerhope.com is the domain name for the website. The last portion of the domain is known as the "domain suffix" or TLD and is used to identify the type or location of website. For example, .com is short for commercial, .org is short for organization, and .co.uk is United Kingdom. There are dozens of other domain suffixes available.
Next, the jargon and u portions of the above URL are the directories of where on the server the web page. In this example, the web page is two directories deep, so if you were trying to find the file on the server it would be in the /public_html/jargon/u directory.
Finally, url.htm is the actual web page on the domain you're viewing. The trailing .htm is the file extension of the web page that indicates the file is an HTML file. Other common file extensions on the Internet include .php, .asp, .cgi, .xml, .jpg, and .gif. Each of these file extensions performs a different function, just like all the different types of files on your computer. See our index.htm definition for additional information about this important file.
What characters are not allowed in a URL?
Most people realize that a space is not allowed in a URL. However, it is also important to realize as documented in RFC 1738 the URL string can only contain alphanumeric characters and !$-_+*'(),. Any other characters that are required in the URL must be encoded.
Understanding more complex URLs
When a URL points to a script that performs additional functions, such as a search engine pointing to a search results page, additional information (paramerters) is added to the end of the URL. Below, is additional information about a URL that points to the Computer Hope Search page with the search query of "example search".
In this URL the script file being pointed to is the search.cgi in the cgi-bin directory. Because this file ends with .cgi you can assume it is a Perl script.
After the script name is a ? (question mark), the question mark in a URL separates the URL from all the parameters or variables that are being sent to the script. In the above example, the parameter being sent is q=example%20search. The "q" is a variable name, and the "example%20search" is the value being sent to that variable. Because no spaces are allowed in a URL, the space has been encoded to %20. In many scripts, a + (plus) is also used to represent a space.
When the script is executed it looks for any variables and since this URL has available variables the URL variables are assigned to variables in the script that can be processed. Scripts are also not limited to only one variable, if the script needs multiple variables each variable can be separated with an & (ampersand) as shown in the example below.
In the above example, there are two different variables, "q" that equals "example search" and "example" that equals "test". If the script was looking for an example variable it could be processed and perform an additional feature.
- Does capitalization and spaces matter in Internet addresses?
- How to create small easy to read URL's
- All Internet related questions and answers.
- Tip to automatically complete a URL.