What is an Absolute Path

What is an absolute path? Not to be confused with relative path, an absolute path is the complete details needed to locate a directory or file in a computer or on a website. This is often referred to as the file path, full path, or absolute pathname.

It uses the root directory and includes any subdirectories needed to locate the file or folder. Absolute paths are used in operating systems and websites to represent file and directory relationships. They are also necessary to the operation of the internet and form the basis of URLs. So, it is used for locating files and folders.

Absolute paths use a root directory that is at the top of the file tree. Meaning that no matter what directory your currently in you can use this path to locate a resource on the system.

For example, in Linux and Unix based operating systems and web servers, the absolute path will usually start with a forward slash (/). Each directory is then separated by forward slashes.

Linux & Unix Absolute Path Example:
/home/jeff/www/blog/index.php

In Microsoft Windows based operating systems and web servers, the absolute path will start with a drive letter (C:). Each directory is then separated by backslashes.

Windows Absolute Path Example:
C:\Windows\Users\jeff\html\docs\blog\index.php

The Unix convention of using forward slashes to separate files and directories on web servers is used on the internet.