NETSCAPE server,location header

NETSCAPE server,location header

Post by Rick Silterr » Sat, 09 Nov 1996 04:00:00



I posted this on the comp.insosystems.www.cgi
group and got no response. I am hoping for some help here.

I have a script that worked fine under Apache,
and CERN.  It ends by generating a location header
to a generated document.
I was just using the virtual path to the document.
Under the enterprise server - I get both the document, correctly
typed, and at the end of the document an error message from
the server - Error 400  Your browser has sent this server a request
it does not understand.
The errors log file file says:
 handle-request reports:
 method without URI

If I send this location header with a complete url, so that it
makes the round trip to the client, I do not get this error.
What gives?

Thanks.


 
 
 

NETSCAPE server,location header

Post by Mike Bro » Thu, 14 Nov 1996 04:00:00



Quote:>I have a script that worked fine under Apache, and CERN.  It ends by
>generating a location header to a generated document.  I was just using
>the virtual path to the document.  Under the enterprise server - I get
>both the document, correctly typed, and at the end of the document an
>error message from the server - Error 400 Your browser has sent this
>server a request it does not understand.
>The errors log file file says:
> handle-request reports:
> method without URI
>If I send this location header with a complete url, so that it makes the
>round trip to the client, I do not get this error. What gives?

As I understand it, the Netscape Commerce Server should be converting the
relative URLs to absolutes before sending them.  But ideally your script
should be supplying it, too.  I'd say change your script, email a bug
report to Netscape, and don't hold your breath waiting for them to fix it
the server.  Also make sure you are sending the redirection in response to
a GET, not a POST.  I'm not sure if this answers your question or not..?

From the Common Gateway Interface IETF draft 1.1 (expired Aug 96, but
most likely still relevant):

9. Data output from the CGI script

   There must be a system defined method for the script to send data
   back to the server or client; a script will always return some data.
   Unless defined otherwise, this will be via the `standard output' file
   descriptor.

   There are two forms of output that the script can give; non-parsed
   header (NPH) output, and parsed header output. A server is only
   required to support the latter; distinguishing between the two types
   of output (or scripts) is implementation defined.

9.1. Non-Parsed Header Output

   The script must return a complete HTTP response message, as described
   in Section 6 of the HTTP specification [3]. Note that this allows an
   HTTP/0.9 response to an HTTP/1.0 request.

   The server should attempt to ensure that the script output is sent
   directly to the client, with minimal buffering.

9.2. Parsed Header Output

   The script returns a CGI response message.

      CGI-Response = *( CGI-Header | HTTP-Header ) NL [ Entity-Body ]
      CGI-Header   = Content-type
                   | Location
                   | Status
                   | extension-header

   The response comprises headers and a body, separated by a blank line.
   The headers are either CGI headers to be interpreted by the server,
   or HTTP headers to be included in the response returned to the client
   if the request method is HTTP. At least one CGI-Header must be
   supplied, but no CGI header can be repeated with the same field-name.

   If a body is supplied, then a Content-type header is required,
   otherwise the script must send a Location or Status header. If a
   Location header is returned, then no HTTP-Headers may be supplied.

[...]

   Location

      This is used to specify to the server that the script is returning
      a reference to a document rather than an actual document.
[...]
      The location value is either an absolute URI with optional
      fragment, as defined in RFC 1630 [1], or an absolute path and
      optional query-string. If an absolute URI is returned by the
      script, then the server will generate a redirect HTTP response
      message, and if no entity body is supplied by the script, then the
      server will produce one. If the Location value is a path, then the
      server will generate the response that it would have produced in
      response to a request containing the URL

         protocol "://" SERVER_NAME ":" SERVER_PORT rel-URL-abs-path

      The location header may only be sent if the REQUEST_METHOD is HEAD
      or GET.

 
 
 

1. redirect (via Location: header) on netscape server

I've got a site on a server that identifies itself as
'Server: Netscape-Communications/1.1'. I want to do
something like an Apache:

        Redirect 301 /oldsite/ http://newsite/

Ie, have the server return a response with error code
301 and a location of the new file whenever someone
tries to get an old file. How and where would I do this?

Everywhere I try to search for this I get stuff about
javascript or <META HTTP-EQUIV=REFRESH ...> which does
not interest me.

Elijah
------
does not know the admin of the oldsite to ask for help

2. Wanted: Perl 5 for Unix.

3. Netscape Enterprise Server 2.0c - Last-Modified: header

4. 1U compatible mb's?

5. Netscape Enterprise Server 3.5.1 Error: Unable to read the header of the

6. intel express 100 known to the kernel but can't be identified?

7. Headers, Headers, whos got the Headers

8. AIX/BBX Job

9. location of iostream header file

10. Content-Location http header

11. Apache 1.2b3 & Location response header

12. linux headers location?

13. Location headers and Status