in reply to Re: Re: CGI Image on localhost
in thread CGI Image on localhost

All in all, apache should do the right thing with slashes.

Here's a long winded explanation on why it's fine...

Let's put it this way. When you click on a link in a browser, it's supposed to issue an http request to the server based on the href. If the href has ../../../ etc, it will strip a few directories in the request. LIkewise if you do ../tmp/../tmp/../tmp. That's basic directory resolving in any os (replace /'s with \'s).

So if you are at http://www/somedir/somedir2 and clicked a link http="../", you'll ask for http://www/somedir , if you clicked http="../somedir2/../somedir2" it should request http://www/somedir2/../somedir2. That is a guess. It may recompress it back to http://somedir/somedir2, but that's somethign to test and play with. not very useful :)

Anyway, the browser should try and compress it somewhat, turning initial ../'s back into something shorter. The request is sent to the server and it can interpret it ANY WAY it wants. Doing something like /cgi-bin/this.cgi/that will pass that as an argument to your this.cgi script. This is a feature of the server 'cause it parses it that way. Well, at least apache did last i checked :) Anyway, last check, apache on windows should translate http://blah/this/../that/ int c:\whereyouinstalledapache\htdocs\this\..\that, which should turn into c:\whereyouinstalledapache\htdocs\that.


Play that funky music white boy..

Replies are listed 'Best First'.
Re: Re: Re: Re: CGI Image on localhost
by eoin (Monk) on Dec 21, 2003 at 23:28 UTC
    ya wha??
    Took me a while but i think I get it now. Cheers.
    Nollaig Shona, Eoin...

    Nollaig shona duit.