Child pages
  • Absolute vs. Relative URL

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migration of unmigrated content due to installation of a new plugin

Definitions

Absolute URL:  the full path to a file including server name and location

Relative URL: the path to a file in relation to another file.  i.e. the location of an image in relation to the html file that is specifying the image

Examples:

Absolute URL

to a file within a Sakai course site's Resources area:

Code Block
https://cle.nps.edu/access/content/group/0e6cf615-18f7-4f3c-a695-f6e252f467a3/Week_1/presentations/Introduction.ppt
  • https://cle.nps.edu - Specifies the server
  • access/content/group - Specifies the Resources area
  • 0e6cf615-18f7-4f3c-a695-f6e252f467a3 - Specifies the Site (This is the site ID)
  • Week_1/presentations - Specifies the folder(s) in which the file is contained
  • Introduction.ppt - Specifies the file name

Relative URL

from a file (typically html) within the Week_1 folder

Code Block
presentations/Introduction.ppt

if a file is within the same directory as the calling file just the file name is needed:

Code Block
Introduction.ppt

if you need to go up a directory use a double dot

Code Block
../Introduction.ppt

Creating Relative URLs in the Sakai html editor

NOTE: Relative URLs will only work from and to files within the Sakai Resources area.  i.e. A relative URL will NOT work from html within the Syllabus tool to a file in the Resources area.

1. Select the text you would like to be the link and use the Globe icon in the html editor.  
(To edit or view an existing link, you can just put your cursor anywhere in the link text)

2. Select the Browse Server button to browse the content in your site's Resources area.
   

3. When you find the file you would like to link to, select it

4. After selecting the file, the Absolute URL will be displayed in the URL field
 

5. To change this absolute URL to Relative, Change the Protocol drop-down to Other

6. Remove the leading information leaving only a relative URL
 

 7. Select the OK button to save your changes.

Video Tutorial

Wiki Markup
{html}
<iframe class="uve" scrolling="no" type="text/html" seamless="true" width="675" height="537" frameborder="0" allowFullScreen="true" webkitallowfullscreen="true" mozallowfullscreen="true" src="https://www.nps.edu/Video/UVE/Embedder/Default.aspx?app=ITACS&mode=html5&media=sakai_absolute_vs_relative.mp4&media_webm=&splash=sakai_absolute_vs_relative.png&usessl=yes&width=650&height=512"></iframe>
{html}