 |

MalaK_3araby
User
Sep 1, 2002, 10:28 PM
Post #1 of 5
(2889 views)
Shortcut
|
path : how do you know which?
|
Can't Post
|
|
Hi guys .. When you wanna call a cgi script file using paths i get lost BIG time .. i.e: <!--#exec cgi="path/some.cgi" --> whats teh difference between a full path and just a path? please tell anything and everything about it .. ot refer me to a good source. Its really frustrating. say i have a domain that is http://domain.com and site is located in /home/sites/domain/web and i place my cgi in cgi-bin .. and want to call it from domain.com/dir1/dir2/dir3 What would the path be? and what method is available to figure it out? -------------- Sure you can spell it, but do you get it?
(This post was edited by MalaK_3araby on Sep 2, 2002, 12:05 AM)
|
|
|  |
 |

Dave
Staff
/ Moderator

Sep 2, 2002, 4:44 PM
Post #2 of 5
(2869 views)
Shortcut
|
|
Re: [MalaK_3araby] path : how do you know which?
[In reply to]
|
Can't Post
|
|
Ok, There's two different things, File Paths and Virtual Paths. File paths are the actual paths on the server and might look like this "/home/www/yoursite.com/htdocs/yourfile.html", etc. Virtual paths are the paths from the root of your website. For example: in http://www.yahoo.com/products/foobar.html the virtual path is "/products/foobar.html". Note: I call them virtual paths, other people/programs might have different names for them (URL paths). I think most people will know what you mean when you say File or Virtual paths though. Ok, so one is talking about the actual location of the file in the file system on the server, and the other is talking about the path to access the file through the webserver. Now, getting slightly more complicated, you have full and relative paths. Full paths always start with / (for both file and virtual). That means, this path starts from the root of either the filesystem or the domain. If you specify a path without a "/" it's assumed that this path is tacked on to the current path. So if you say "images/happy.gif" you're saying looking in the folder called "images" under the current folder (whereever that is). Also, with relative paths you can use .. to mean "up one folder from where we are now" and . to mean "this folder". So saying ../images/ means go up one folder from where we are now and look for a folder called images. When you're talking about SSIs and the exec cgi directive you're talking about virtual paths. That is, URL paths and not file system paths. So let's say you have a page here: http://www.domain.com/products/widget.html And you want to include a cgi SSI in /products/includes/magic.cgi. You could do it one of two ways. Since you're already in the /products/ directory you could use a relative virtual path like this: <!--#exec cgi="includes/magic.cgi" --> or, you could use the full virtual path, meaning, the full path from the root of the domain, like this: <!--#exec cgi="/products/includes/magic.cgi" --> The benefit of using the full path is that it will work the same way where ever your page is on your site. And you can use the same SSI all over your site and have it work, instead of having relative URLs specific to each folder you may have. Hope that helps. For more info on Apache SSIs check out the docs at: http://httpd.apache.org/docs/mod/mod_include.html Dave Edis - Senior Developer interactivetools.com
|
|
|  |
 |

MalaK_3araby
User
Sep 2, 2002, 9:27 PM
Post #3 of 5
(2860 views)
Shortcut
|
|
Re: [Dave] path : how do you know which?
[In reply to]
|
Can't Post
|
|
Dave ... I went on reading and reading on the net .. and i must have read tons of info until i solved my problem trying different thinsg but still not understanding ... Your answer just put it all in prospective for me .. i mean to say : it all makes sense now. You are so kind and helppful .. i really appreciate this explanation. Thank You Dave. /me is off trying all little addons that have been saved for this day. -------------- Sure you can spell it, but do you get it?
|
|
|  |
 |

canvey
User
Sep 8, 2002, 5:52 AM
Post #4 of 5
(2828 views)
Shortcut
|
|
Re: [Dave] path : how do you know which?
[In reply to]
|
Can't Post
|
|
If ../ goes up one level does ../../ go up two levels etc.?
|
|
|  |
 |

Dave
Staff
/ Moderator

Sep 9, 2002, 10:38 AM
Post #5 of 5
(2821 views)
Shortcut
|
|
Re: [canvey] path : how do you know which?
[In reply to]
|
Can't Post
|
|
>If ../ goes up one level does ../../ go up two levels etc.? You got it. :) In fact, sometimes you'll might see weird URLs or links like this: /dir1/dir2/../../dir3/file.html which would work out to be "/dir3/file.html". Dave Edis - Senior Developer interactivetools.com
|
|
|  |
|