How to Make Relative Links


The purpose of this web page is to teach you how to make all your web hyperlinks relative links. What this means is if the file (image or text) is going to be in your folder on the web server, then there is a great advantage if you do not type out the entire URL to create this linkage. Relative links are an easier way for you to link your pages together (and one that will save me a lot of headache when it comes time to save your web pages in the BioServer Archives).

 

For Files all in the Same Single Folder

Let's say you wanted to link from your home page (called homepage.html) to your assignment on a method. You could type in the entire URL <http://www.bio.davidson.edu/Biology/Courses/Molbio/Mol%20Students/username/method.html>, but that is too much effort and you might make a mistake. Since you are a sophisticated web designer, you will make a relative link. If the methods assignment is in the same folder you simply use the file name <method.html>.


For Files in Different Folders

Your review paper must be in a folder called "restricted" within your main folder. This will block access to your paper from any user who is not on campus. [This is the Biology Department's effort to minimize plagarism by people off campus.] To link from your home page to this review paper, you would enter the location as <restricted/review.html>. This tells the browser to look for an internal folder called restricted and inside that folder find a file called review.html. To link back from the review paper to your home page, you would enter the location <../homepage.html>. The portion "../" tells the browser that the file you are looking for is in the parent folder so no name is need, only the particular file name.

 

For Help with More Complex Web Sites


Learn How to Access Your Folder on the Biology Web Server

Return to Molecular Biology Spring '98

Return To Biology Main Page



© Copyright 2000 Department of Biology, Davidson College, Davidson, NC 28036
Send comments, questions, and suggestions to: macampbell@davidson.edu