This is the whole thing of server side or clientside.
On the client side you have to ask for info according to the url because you're out there on a PC asking for stuff from a webserver.
On the webserver you're asking for stuff within that box and you don't care if it's visible via a url or not. Therefore you have to use it's internal file structure.
The way to use this is
anything people can call from a web browser goes above the htdocs or public_html folder
anything valuable and used in processing can be in a structure that starts below the htdocs.
therefore
/home/alexsta/public_html/nav.php is a page which can be called by the public
/home/alexsta/includes/mypasswords.php is hidden from the public but can be included by nav.php
does this make sense?