Skip to the content
k-state mainhead

build a new page

Relative links

Relative links will save you a lot of time if you ever change your web address.

Once a file cabinet has been opened and the user is staring at a file, you do not need to tell him to exit and reopen the cabinet every time to locate another file inside the same cabinet. You will use a partial address to move the user around the cabinet, leading him from a folder to one directly inside or outside.

The advantage of relative links is twofold. One, the computer doesn't need to take the time to close and reenter the same cabinet, so the webpage will load faster for the user. Two, a relative link makes associations by folders and does not depend on the server address (the http://...com) to find files. Therefore, if this part of the address changes (i.e., from http://consider-new.k-state.edu to http://consider.k-state.edu as it replaces the old website), all the links will still work. Otherwise, the publisher must manually change every single link on the site.

Examine the following chart:



The cabinet is http://consider.k-state.edu. Directly inside the cabinet exists an admissions folder, an apply folder, and an index page.

Once inside the cabinet, the cabinet name should never be used again to link to another file. Look at the some examples:

Linking from an index page to a page in the same folder

A link needs to be created from ged.htm to the index page of the apply folder.



First, select the text or object to link. Click the Link button (8), and choose Browse to Web Page.

 


The Insert Link dialog box will open. This time, you will use the Advanced options HREF box to create a relative link. Type "/apply" into the HREF box.

You only need to add the part of the address that is different at the end of the address. In this example that part is "/apply"; the "http://www.consider.k-state.edu/ged.htm" part is the same.

Make sure to leave the Target frame on "Default," meaning the new page will open in the same window.

 


Note that by putting the relative link into the HREF box, the Web address (URL) box filled itself in, but if the name of the "consider" folder ("http://consider.k-state.edu" means that the website is contained in the "consider" folder on the "k-state.edu" server") is changed, the link will still work because only the HREF is permanent.

Linking from a page to a page in a different folder

If you need to link pages in different folders, you'll follow the same process. But the address you type in the HREF box will be longer.

For example, let's add a link from the apply index page—which is inside the apply folder—to the precollege.htm page in the admissions folder.


 

Select the link object or text on the apply page. Click the Link button, and choose Browse to Web Page. Type "/admissions/precollege.htm" into the HREF box. Again, leave the Target frame on "Default" for a link that is on the same website.


Continue to next section.