The redirect you want to do is done via the HTTP Status #302. Since this is HTTP you need to send it with the header. Therefore the header you're sending out is superflous. You have a normal HTTP header (hopefully status code #200), everything that follows is considered being HTML, that's why you see "Status: 302 Moved location: ..." in your browser window. Exactly this should be your HTTP header. By the way: not only should you make the path absolute, but even give a complete URL. Your response might look like this:
Status: 302 FOUND
Localtion: http://www.foo.com/cgi-bin/bar.cgi?qwz=qwzz
Content-type: text/plain
please go to http://www.foo.com/cgi-bin/bar.cgi?qwz=qwzz
Regards,
-octo-
--
GED/CC d-- s:- a--- C++(+++) UL+++ P++++$ L++>++++ E--- W+++@ N o? K? w-- O- M-(+) V? !PS !PE !Y PGP+(++) t-- 5 X+ R+(+++) tv+(++) b++@ DI+() D+ G++ e->+++ h!++ r+(++) y+