Extras
Different Types of Root Directory:
Filesystem vs Application vs Document Root
When you are talking about a file system, the filesystem root directory is the topmost folder in the file system.
When creating a website, there are two other root directories for that site, the application root and the document root.
Filesystem Root
The filesystem root folder usually refers to the topmost folder on your computer.
On Windows, this is usually represented by a drive letter (followed by a colon), then a backslash to represent the root folder of that drive, such as C:\
On a Mac or Linux, it is usually represented by a forward slash /
Application Root
The application root folder contains all of the files that a website needs when it is moved to a new server.
It may contain class files, function definitions, includes, and other files that are above the document root. These files can be accessed by the web server, but they cannot be opened via a URL.
Document Root
The document root folder contains every file that can be requested via a URL, including CSS, JavaScript and image files.
This folder should map to your domain name, so if your document root folder contains a folder called img
which holds an image called test.jpg
and your domain is example.org
you should be able to view it at http://example.org/img/test.jpg
.
Filesystem root | Application root | Document root | |||||
HD
>
|
Users
>
|
eghost
>
|
phpandmysql.com
>
|
lib
>
|
htdocs
>
|
css
>
|
test.jpg
|
javascriptbook.com
>
|
logs
>
|
img
>
|
|||||
htmlandcssbook.com
>
|
web
>
|
index.php
|