You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Rob Hartill <ro...@imdb.com> on 1996/10/17 12:33:24 UTC
Re: Probably not a bug?
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?.