HTML Links and URL Lab - savannahc502/SavC-TechJournal-SEC260 GitHub Wiki

This lab follows: Simple Web Server and Page CentOS


Basics of Creating Web Pages in Directories

Helpful Commands:

  • mkdir
  • rmdir
  • cd
  • rmdir
  • tree
  • mv
    • Renaming files
  • wget
    • Gets an image from a link
    • Use the "image link" of a photo
    • Must use an authorized page

Basic HTML Format:

<HTML>
  <head>
    <title>
      Title goes here
    </title>
  </head>
  <body>
    stuff goes here
  </body>
</html>

My Directory Tree at the End:

image


Relative vs. Absolute Paths

Defining:

  • Absolute Paths = the entire path to the resource
  • Relative Paths = part of the absolute path, assumes the missing first half is in the current working directory
    • You can only use relative links when linking to pages or files within your site, and you must use absolute links if you're linking to a location on another website.

Demonstrating Relative vs. Absolute Paths

image

  • A relative path on my default home page, index.php, leads to the about directory's test HTML file

image

  • The about page has three more absolute paths, two on my own web server and one to a classmate's server

image

  • Here I have four relative paths and one absolute path
  • This means that the relative path directories have to be subdirectories in locations

image

  • On the Montreal Page, I included an image that I had to download using the wget command
⚠️ **GitHub.com Fallback** ⚠️