Re: Directory to URL translation in CGI script

M. Hedlund (ir000697@interramp.com)
Tue, 28 Mar 1995 19:53:04 -0800

+--- mufti@cis.ohio-state.edu (saad mufti) wrote:
+ Is there any way in a CGI script to translate a given Unix directory
+ path to a base URL, or to tell that it doesn't correspond to any valid
+ URL with respect to the server that launched the CGI script?
+
+ The only way I can think of is to parse the server configuration file
+ and do a reverse mapping, but that is too specific to the kind of HTTP
+ server that you happend to be using.
+---

I know of no general solution to this problem, for the reason you
mention. Most utilities I've seen just ask you to specify your ServerRoot
in a configuration file (such as Boutell's wusage) or as a variable
defined at the head of the program (my preferred method). It doesn't seem
like too much to ask.
M. Hedlund <march@europa.com>