Update: I didn't clue in that you were launching the script via SSI. In SSI includes, the header is apparently ignored (which makes sense cause you can't send multiple headers). See almut's reply instead.
It works fine for me
#!/usr/bin/perl -w
use strict;
use CGI q~:standard~;
use DBI;
use CGI::Cookie;
use CGI::Carp q~fatalsToBrowser~;
print redirect(-location => 'http://admin.ffinfo.com/');
But I could see it failing if the script was fetched executed using POST instead of GET.
If the 302 status code is received in response to a request other
than GET or HEAD, the user agent MUST NOT automatically redirect the
request unless it can be confirmed by the user, since this might
change the conditions under which the request was issued.
You may want a 303.
The response to the request can be found under a different URI and
SHOULD be retrieved using a GET method on that resource. This method
exists primarily to allow the output of a POST-activated script to
redirect the user agent to a selected resource.
If you can't get it to work, execute the script from the prompt and show us what you get. You may also want to find out what the browser is receiving using a browser plugin or a packet sniffer.
|