httpd-users mailing list archives

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

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:

---
Location: http://127.0.0.1/~joris/cgi-bin/cache/page.html
Content-Type: text/html

<html>
[snip]
</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,

Joris

---------- Joris.Vankerschaver@ugent.be --------------

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message