redirect using location header does not work from an already redirected doc.

From: Will (goodwill_at_alloymail.com)
Date: 11/30/03


Date: 29 Nov 2003 20:35:43 -0800

interesting situation:

OS: Windows
Server: Apache 1.3.29

Modified ErrorDocument 404 to point to a redirect.pl script in cgi-bin
http.conf
  ErrorDocument 404 /cgi-bin/redirect.pl

redirect.pl
sub DO_REDIRECT {
 ...

 print "Location: /index.html \n\n";

 ...
}

this works when I access the script directly by its url.
but when its forwarded to by the 404 error it does not work.

Any one has any idea how to make it work, please reply.

Additional Info ... :
I tried printing out the headers manually but it does not work.

lets say: http://yourdomain.com/some_nonsensical_stuff_here

Here are some headers from the 404 redirect:

GET /some_nonsensical_stuff_here HTTP/1.1
-server headers-
HTTP/1.z 404 Not Found
Server: Apache/1.3.29 (Win32)
Location: http://yourdomain.com/index.html
Keep-Alive: timeout=15, max=100
Connection: Keep-Alive
Transfer-Encoding: chunked
Content-Type: text/plain

The header from accessing the url directly are a bit different:

GET /index.html HTTP/1.1
-server headers-
HTTP/1.z 200 OK
Server: Apache/1.3.29 (Win32)
Etag: "0-5d6-3af1f126"
Accept-Ranges: bytes
Content-Length: 1494
Content-Type: text/html



Relevant Pages

  • Re: SMTP OnArrival Transport Event Sink
    ... have the script extract the sender list, ... fine when it runs on a windows 2003 server with the smtp service enabled. ... Sub IEventIsCacheable_IsCacheable ...
    (microsoft.public.exchange.development)
  • Re: Same Internal Server Error from last two days
    ... I am trying to run a Hello World Perl Script in Apache 2.2. ... But its constantly giving me Internal Server Error.The script ... # have to place corresponding `LoadModule' lines at this location so the ...
    (perl.beginners)
  • Re: Same Internal Server Error from last two days
    ... I am trying to run a Hello World Perl Script in Apache 2.2. ... But its constantly giving me Internal Server Error.The script Runs perfectly fine from the command prompt. ... # This is the main Apache HTTP server configuration file. ... LoadModule actions_module modules/mod_actions.so ...
    (perl.beginners)
  • Same Internal Server Error from last two days
    ... I am trying to run a Hello World Perl Script in Apache 2.2. ... But its constantly giving me Internal Server Error.The script ... # have to place corresponding `LoadModule' lines at this location so the ...
    (perl.beginners)
  • Re: how to go from VB in a page to ASP in another page and come back
    ... > but if i understand your code, the value from ASP is put outside the SUB. ... script, meaning it is executed in the browser, not the server. ... if you have this in a client event ...
    (microsoft.public.inetserver.asp.general)