[7697] in www-talk@info.cern.ch

home help back first fref pref prev next nref lref last post

Re: CGI PATH_TRANSLATED variable?

daemon@ATHENA.MIT.EDU (Mike Meyer)
Thu Mar 23 00:20:33 1995

Date: Thu, 23 Mar 1995 00:15:22 +0500
Errors-To: procmaster@www19.w3.org
Reply-To: mwm@contessa.phone.net
From: mwm@contessa.phone.net (Mike Meyer)
To: Multiple recipients of list <www-talk@www10.w3.org>

> Not quite.  If you have the serverroot at
>   /var/web
> and you have /htdocs and /cgi-bin  in the serverroot dir, and you have
> two documents in /htdocs called
>   /foo.html and /baz/bar.html
> then a request for /var/web/htdocs/foo.html looks like this
>    http://yourserver/foo.html
> and baz/bar.html is
>    http://yourserver/baz/bar.html

Yes, but note that this assumes that all your html documents live in
one tree. What if that's not the case? In particular, what if your
server could hand either of /var/web/htdocs/foo.html or
/var/web/htdocs-new/foo.html if someone tryed to GET
http://yourserver/foo.html?

> Running through a gateway at
>    http://yourserver/cgi-bin/script
> the request using PATHINFO .html would be
>    http://yourserver/cgi-bin/script/foo.html
>       PATH_INFO= /foo.html
>       PATH_TRANSLATED= /var/web/htdocs/foo.html

Should PATH_TRANSLATED be /var/web/{htdocs,htdocs-new}/foo.html for
the case I've got?

> The advantage is that the server will do user-dir escaping for you, so
>    http://yourserver/cgi-bin/script/~baz/bar.html
>       PATH_INFO= /~baz/bar.html
>       PATH_TRANSLATED= /u/baz/public_html/bar.html

This only applies if your server does user-dir escaping. Mine doesn't
(yet, anyway).

	Thanx,
	<mike



home help back first fref pref prev next nref lref last post