PDA

View Full Version : Use of absolute paths


mytokyo
06-09-2005, 12:31 PM
Hi,

I am relatively new. If this was covered before I am sorry.

My question is related to how to use absolute paths more effectively. If I have a file as /big/dom/mydomain/www/myfolder/file.txt, is there a way to reference it like /myfolder/file.txt in SSI files or CGIs, instead of using a long absolute path?

If there is a way, then I can have an /includes/ folder under www and can reference it as /includes/. I will appreciate comments and suggestions.

CDarklock
06-09-2005, 01:30 PM
Most CGI languages include a way to get what people usually call the "document root", which in your case would be "/big/dom/mydomain/www". You can then simply tack the rest of your path (what people usually call the "virtual path") onto the end.

SSI normally doesn't allow non-virtual paths, so you shouldn't have this problem there. Well, Apache mod_include doesn't allow them, anyway.