You may wish to check out Rob Mayoff's utility dqd_internalredirect - a wrapper around the C API function Ns_ConnRedirect. This lets you send back the contents of a different URL (from the same server) without letting the client know. See
http://dqd.com/~mayoff/aolserver/ for details. It doesn't solve the problem you describe, but perhaps you may find use for it in another context.