70
81
LINKS
structure
The diagram on the right shows
the directory structure for a
fictional entertainment listings
website called ExampleArts.
The top-level folder is known
as the root folder. (In this
example, the root folder is called
examplearts.) The root folder
contains all of the other files and
folders for a website.
Each section of the site is placed
in a separate folder; this helps
organize the files.
reLAtionshiPs
The relationship between
files and folders on a website
is described using the same
terminology as a family tree.
In the diagram on the right, you
can see some relationships have
been drawn in.
The examplearts folder is a
parent of the movies, music
and theater folders. And the
the movies, music and theater
folders are children of the
examplearts folder.
homePAges
The main homepage of a site
written in HTML (and the
homepages of each section in a
child folder) is called index.html.
Web servers are usually set up
to return the index.html file if no
file name is specified.
Therefore, if you enter
examplearts.com
it will return
examplearts.com/index
.html
, and
examplearts.com/
music
will return
examplearts
.com/music/index.html
.
On larger websites it's a good idea to organize your code by placing the
pages for each different section of the site into a new folder. Folders on a
website are sometimes referred to as directories.
Directory structure
If you are working with a content
management system, blogging
software, or an e-commerce
system, you might not have
individual files for each page of
the website.
Instead, these systems often
use one template file for each
different type of page (such as
news articles, blog posts, or
products).
Editing the template file would
change all of the pages that use
that template. Do not change
any code that is not HTML or
you may break the page.