File organization and Pathnames

Project file organization and navigation

Where should your website live on your computer? What structure should your website have?

Standard file organization

Sample webspace organization

Practice good file management! Use standard hierarchy structure, conceptual and physical diagrams.

File paths (pathnames)

Syntax <a href="path/file.html">Link label</a>

  • Linking to file in a same directory (current directory is XXX): code in b.html, linking to c.html
    <a href="c.html">Link label</a>
  • Linking to file in a parent directory: code in b.html, linking to a.html
    <a href="../a.html">Link label</a>
  • Linking to file in a subdirectory: code in a.html, linking to b.html
    <a href="XXX/b.html">Link label</a>
  • absolute URL:
    <a href="http://www.apache.org/foundation/FAQ.html">Apache Software Foundation FAQ</a>

Navigating directory tree

Path What it means…
<a href="tips/page.html"> page.html is located in a directory called tips. The file containing this code is located in the current directory.
<a href="tips/other/page.html"> page.html is located in a directory called other that is located in a folder called tips that is located in the current directory.
<a href="../../page.html"> page.html is located in a directory two levels up from the current directory.