Apache 1.2b3 & Location response header

Apache 1.2b3 & Location response header

Post by Thomas Moulto » Tue, 31 Dec 1996 04:00:00



I'm trying to utilize the Location response header.  I'm running Apache
1.23b on a FreeBSD box w/ Netscape 3.0.  I've followed the syntax of a
few CGI FAQ's.  One in particular states...

BEGIN FAQ QUOTE:

Q4.23: Why doesn't:

print "Location: http://host/page.html\n"

work? Why does it only work the first time and get the redirects wrong
later?

A CGI program can only send one Location header. You also cannot send a
MIME content type if you want the
server to perform redirection. For example, this is not valid, though it
may work with some servers:

     #!/usr/local/bin/perl

     .
     .
     .
     print "Content-type: text/plain\n"
     print "Location: http://some.machine/some.doc\n\n"";

END FAQ QUOTE

I created a simple perl CGI script to test out this response header;
however, the server chokes and returns the following error...

BEGIN SERVER ERROR:

Internal Server Error

The server encountered an internal error or misconfiguration and was
unable to complete your request.


of the time the error occurred, and
anything you might have done that may have caused the error.

END SERVER ERROR

BEGIN MY SIMPLE PERL TEST SCRIPT:

#!/usr/local/bin/perl

print "Location:  lila.east.isi.edu/~moulton/env.html\n";

END MY SIMPLE PERL TEST SCRIPT

I am uncertain if this has to do with the server or with the Netscape
3.0 browser that I'm using.  From the lack of documentation of this
"Location" response header I'm figuring its pretty new.  I've got three
books on CGI development and only one mentions the "Location" response
header (in small detail).

I'm sure this is simply operator error; however, I've seen no concrete
documentation on how to properly use the "Location" response header.  Is
there any documentation on which response headers Apache supports and
how to utilize them?  Anyone know of an exceptionally good CGI FAQ to
boot?

Sincerely,

--
*****************************************************************
** Thomas Moulton                                              **
** ----------------------------------------------------------- **

*****************************************************************

 
 
 

Apache 1.2b3 & Location response header

Post by Thomas Moulto » Tue, 31 Dec 1996 04:00:00



> I'm trying to utilize the Location response header.  I'm running Apache
> 1.23b on a FreeBSD box w/ Netscape 3.0.  I've followed the syntax of a
> few CGI FAQ's.  One in particular states...

> ...

I have solved my problem.  Thanks, to Thomas Boutell's FAQ (very good I
might add) I found out that I needed two line breaks immediately
following the "Location" response header.  Talk about tempermental? ;-)
My apologies for wasting time on this news group.

--
*****************************************************************
** Thomas Moulton                                              **
** ----------------------------------------------------------- **

*****************************************************************

 
 
 

1. Apache 1.2b3 & setrlimit on Unixware 2.1

I am having a problem w/ Apache starting up.  It seems that it runs out
of file handles because of multiple v-hosts and 4 logs per site.  

Would the code in http_config #ifdefine RLIMIT_NOFILE resolve this
problem.

I am not a developer, but I think this will do it.

So if I add #define RLIMIT_NOFILE to conf.h in the uw section under #elif
define (UW), will this fix my prob?  

TIA
-Peter Baker

2. Reading Files with KSH

3. Apache 1.2b3 & Linux 2.0.0

4. Dodgy DDS2 4mm Drives

5. Q: [APACHE] "Location: " response doesn't work??

6. TZ and PID Problems

7. Howto rewrite HTTP response headers with Apache?

8. I Need A Shell Script, Or A C Program....

9. Apache 1.3.20: ap_send_http_header() sends Content-Type header when response contains no body

10. Response Headers on Apache

11. inconsistencies in header responses using Apache 2.0.35 on Windows 2000 and Solaris 8

12. Apache 1.3.x: What headers are added just before response is sent?

13. Apache and Location Header