in reply to URL redirection

Works for me:

Q:\>perl -MCGI=redirect -e "print redirect('http://google.de')" Status: 302 Moved Location: http://google.de

Maybe you didn't print the result from ->redirect? Otherwise, it's always helpful to tell us how exactly things do not work, and maybe tell us the entries in the server error log as well.

Replies are listed 'Best First'.
Re^2: URL redirection
by Anonymous Monk on Oct 22, 2007 at 09:28 UTC
    Sorry for insufficient infomation.
    my $username=$cgi->param('username'); if ($username eq 'testuser'){ print $cgi->redirect("http://navitwiki/cgi-bin/main.cgi"); }else{ $message='Please Check the Username & Password'; &init_screen(); }


    this is my code. While running only the following text is displayed . but i want to open the mentioned script in the browser .
    URL Status: 302 Moved Location: http://navitwiki/cgi-bin/main.cgi

      So, the most likely cause is that you or your script output something else before the redirect is printed, because, as you see in the output, the Location: header is there. Run your script on the command line to see what it outputs, or use the GET command from LWP to see what your script outputs:

      GET -USe http://...

      ... or alternatively, debug what is output via telnet.