ABSOLUTE & RELATIVE URLS HOW TO USE THEM ON WEBPAGES |
---|
A url is the internet address of a webpage. Here are the examples we'll use in this tutorial: <http://yourdomain.com/directory2/mygarden.html> The examples above are called "absolute" urls, because they contain the complete address of the webpage. On the "My Home" page in Directory 1, you want to put a link to "My Garden" page in Directory 2. You could use the absolute (complete) url like this: But this requires the visitor's browser to go back out of your My Home page and your file manager to the internet, and then back into your file manager to get the My Garden page. To make the My Garden page load faster, you can remove the domain part of the absolute url: http://yourdomain.com, and just use the rest of the url: Note: You must include a slash (/) before the directory2 in the url. If you have another page in Directory 1 that you want to link to on your My Home page, the relative url is even shorter, bcause you won't need to use the directory name: Note: In this case, when the page is in the same directory, you omit the slash (/) before the page name. If you start using relative urls to make the links on your pages, you will save on the file size of each page, too. Copyright © 2003, All Rights Reserved |