I just thought of this and was wondering if it is possible. So similar to how you can relatively reference a parent folder using ../. Is there a way to access a parent directory if a domain name is associated with a sub-folder. For instance, on my server, I have a certain web site on 192.168.1.23/Site. I have an associated shorter url connected to it. For instance site.co.nr. Is there a way to get to 192.168.1.23 (or there associated ethernet IP) home directory using relative addresses using site.co.nr? Maybe like ../site.co.nr? Or something like that? Sorry if this is stupid, I am just curious. Thanks!

Maybe i am not comprehending your question, but usually when you have the site setup on a subfolder, you simply configure your web server's home directory to be that of the subfolder, rather than the root folder.

Maybe my question was just silly. With what you just said in mind, can you access that parent directory from the server's new home directory which is in fact a sub directory of the parent ^?

My answer and based on my experience, i would say no. Using relative paths, the highest you'll get is to the root of the web application (even if that root is a sub-directory of some other directory in the file system). Think about a web server that hosts multiple web sites. The directory structure may be that you have a folder called "websites" with multiple sub directories, each with sub-directory being a website. When you configure the various websites in your web server application, each is independent of each other. Regardless if they follow a parent/subdomain namespace, or not, as you (within your web app) move up the path "../", you'll stop at the root of the web.

I am thinking..thinking..are there any tricks or exceptions...hmmm.. cant think of any. would like to hear from someone if there is method, other than specifying the absolute URL of the parent website.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.