Welcome to the OzoneAsylum FaqWiki
Frequently Asked Questions
Server Side Coding
General server-side coding

What's a relative and an absolute path? Pages that link to <a href="https://ozoneasylum.com/backlink?for=5737" title="Pages that link to What&amp;#039;s a relative and an absolute path?" rel="nofollow" >What&#039;s a relative and an absolute path?\

Well, a relative path is relative
to the current directory...
say you're in /shu then 'sha' would be /shu/sha.

An absolute path, which always starts with a / would be
/sha. this is not /shu/sha, but /sha. Somewhere else enterly.

Note: Absolute paths in urls are from the webroot.
Absolute paths in cgi scripts (including perl and php) are from the webservers internal root.
On most shared hosting, your webroot is deep down in something like /usr/customers/joeWebmaster/


(Added by: Tyberius Prime on Fri 20-Jun-2003)

Btw, some claim that using absolute paths for urls is slower than relative ones, because the browser supposedly creates a new connection each time he encounters an absolute path.
I'd take this info with a grain of salt, because in http 1.0, each request creates a new connection, anyway, and with http 1.1, I'd believe browsers to be smart enough to handle this correctly (ie. by not opening a new connection to the same server).

(Edited by: Tyberius Prime on Fri 20-Jun-2003)

« BackwardsOnwards »

Show Forum Drop Down Menu