Received: by taz.hyperreal.com (8.7.6/V2.0) id FAA18050; Thu, 17 Oct 1996 05:09:36 -0700 (PDT) Received: from nora.pcug.co.uk by taz.hyperreal.com (8.7.6/V2.0) with SMTP id FAA18043; Thu, 17 Oct 1996 05:09:33 -0700 (PDT) Received: from imdb.demon.co.uk by nora.pcug.co.uk id aa11259; 17 Oct 96 12:19 BST Message-Id: <199610171033.LAA02222> Subject: Re: Probably not a bug? To: huver@amgraf.com Date: Thu, 17 Oct 1996 11:33:24 +0100 (BST) In-Reply-To: <199610162225.RAA14848@amgraf.com> from "Huver" at Oct 16, 96 05:25:48 pm From: Rob Hartill Organization: Internet Movie Database X-pgp-public-key: http://us.imdb.com/pgp.html X-Mailer: ELM [version 2.4 PL24 ME8a] Content-Type: text Sender: owner-new-httpd@apache.org Precedence: bulk Reply-To: new-httpd@hyperreal.com hi, I'll forward your mail to the developers list. If anyone is interested in your ideas I'm sure they'll let you know. cheers, rob Huver wrote: > >This is strictly not a bug report, but an alternative way to redirect >a server when a client does not ask for any specific URL. > >Suppose the srm.conf has: > > DirectoryIndex index.html > ..... > Redirect /index.html http://some-other-host > >This is the way I use with NCSA and CERN servers to temporarily point >to somewhere else (while I try things out with the local server and >cgi scripts/programs). > >It didn't work with apache 1.1.1; although the how-to docs say one can >write a script for this purpose, I didn't want to write a script just >for this. So I looked and it seemed to me the function handle_dir() >in mod_dir.c did not check to see if the DEFAULT_INDEX contains a token >that has been redirected (which sub_req_lookup_uri() does indicate). > >The short context diff below shows what I did to make the redirect work >(I simply added the status code REDIRECT check), without a script. > > >*** mod_dir.old.c Fri Jun 21 15:12:07 1996 >--- mod_dir.c Wed Oct 16 16:24:53 1996 >*************** >*** 794,801 **** > > char *name_ptr = getword_conf (r->pool, &names_ptr); > request_rec *rr = sub_req_lookup_uri (name_ptr, r); >! >! if (rr->status == 200 && rr->finfo.st_mode != 0) { > char* new_uri = escape_uri(r->pool, rr->uri); > > if (rr->args != NULL) >--- 794,802 ---- > > char *name_ptr = getword_conf (r->pool, &names_ptr); > request_rec *rr = sub_req_lookup_uri (name_ptr, r); >! >! if (rr->status == REDIRECT >! || (rr->status == DOCUMENT_FOLLOWS && rr->finfo.st_mode != 0)) { > char* new_uri = escape_uri(r->pool, rr->uri); > > if (rr->args != NULL) > > >================ > >One other thing I'm not sure if anyone may be interested: I added some >code in mod_cgi.c for the SCO Unix 3.2.2r4 (the one prior to openserver) >on which exec(2) does not load a script (specifically, it lacks the '#!' >functionality and barks on any file that doesn't have a magic header). >The added code reads the first line from the named file, checks for '#!' >and reformats the exec(2) arg list accordingly. I did this because we >plan to give apache to our customers who use such SCO systems so they >can view our doc files in HTML format. As is, the kludge is crude but >it gets the job done. If anyone likes to have this, let me know and >I'll send the context diff. > > >-huver huver@amgraf.com > -- Rob Hartill (robh@imdb.com) http://www.imdb.com/ ... why wait for a clear night to see the stars?.