httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joris Vankerschaver <>
Subject [users@httpd] Redirection
Date Thu, 02 Oct 2003 07:14:16 GMT

I'm experiencing strange behaviour with my CGI setup under Apache 2.0.47.
The problem is the following:  I want to set up some sort of Funky
Caching, where a 404 error is generated as soon as a page is not found.
Through a custom .htaccess file, a CGI script is then called to regenerate
this page and redirect the browser to this new page.

It is precisely in this last step that I have a problem.  To redirect, my
script outputs the following:

Content-Type: text/html


Whenever I call the CGI script directly (i.e. by entering the URL in my
browser), redirection works OK.  But - and this is the funny thing -
whenever it's called through my .htaccess file, the redirection fails:
the HTTP headers seem to be ignored and all I see is the HTML ([snip] in
the excerpt).  My .htaccess contains the following line:

ErrorDocument 404 /~joris/cgi-bin/refresh.cgi

Can someone help me with this?  I don't need a full solution (though this
would be nice), a pointer to a reference about the things Apache does when
it encounters a 404 would be nice too...

I really tried about everything to cure this problem: I checked the usual
sources for help (web, archives, Apache docs), tried different solutions
and looked at other people's sourcecode (most people don't use
redirection, instead they open the html file they've just regenerated and
output that.  I didn't find that a very elegant solution - though it might
be the only thing that works...), so that's why I post this message here:
I'm really, really stuck...

Thank you for your consideration,


---------- --------------

The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:> for more info.
To unsubscribe, e-mail:
   "   from the digest:
For additional commands, e-mail:

View raw message