in reply to Redirection Failure from SHTML

CGI's header() method is for sending HTTP headers, not meta HTTP tags. To send an HTTP redirect, you can use:

header(-location => 'http://foobar.com/');

Note that the HTTP standard does not have a timing feature; if you send the redirect the browser will go there right away.

If you use it from within an SSI, be sure that it's executed before anything else in the file, as mod_include will send default headers as soon as it encounters some data to send. (I think there may be a way to suppress this behavior, however. Check the mod_include docs.)

Replies are listed 'Best First'.
Re^2: Redirection Failure from SHTML
by Anonymous Monk on Feb 12, 2005 at 04:02 UTC
    I've used the header to print out Meta tags. That code with the meta worked just fine.
    I did use what you suggested and I got an error: "[an error occurred while processing this directive]" and yes the script was the first thing to send out. I dunno what else it could be. I guess I'll scrap it and work it another way...
Re^2: Redirection Failure from SHTML
by Aristotle (Chancellor) on Feb 19, 2005 at 03:24 UTC

    Uh, just FYI, meta tags began life as a way to specific information that was supposed to be in the HTTP response header within the document instead.

    Makeshifts last the longest.