Directory Structure

Organizing Files and Folder Structure for Web Pages
It is a good idea to organize your code by placing the pages for each different section of the site into a new folder. Folders are referred to as directories on websites.

directory-structure
Diagram of the directory structure for a website called Example-Site.

Structure
The top-level is known as the root folder. (In this example is know as the root folder called examples-site.) The root folder is contains all the other files and folders for a website.

Relationships
The relationship between files and folders on a website is described using the same terminology as a family tree.
The example-site folder is a parent of the activities, music and theater folders.
The  activitiesmusic and theater folders are children of the example-site folder.

Homepages
The main homages of a site written in HTML is called index.html ( and the homepage of each section in a child folder).
Web servers are usually set up to return to the index.html file if no file name is specified.
Therefore, if you enter example-site.com it will return example-site.com/index.html, and example-site.com/music will return example-site.com/music/index.html.


The root folder contains:

  • A file called index.html which is the homepage for the entire site
  • Individual folders for the activities, music and theater section of the site

Each sub-directory contains:

  • A file called index.html which is the homepage for that section
  • A review page called reviews.html
  • A listing page called listing.html6
Advertisements