Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

CGI::Application redirect not working

by shak380 (Novice)
on Mar 20, 2013 at 14:38 UTC ( #1024530=perlquestion: print w/ replies, xml ) Need Help??
shak380 has asked for the wisdom of the Perl Monks concerning the following question:

In our CGI::Application code we have a redirect like this :
sub run_mode_xxx { return $self->header_props( -uri => $url ); }
It did not work on either Apache1 or Apache2. So I changed it like this :
sub run_mode_xxx { $self->header_add( -location => $url ); return; }
Now, it works on Apache2, but Apache1 shows "The document has moved here". We have tried with :
return $self->header_props( -uri => $url );
Still no luck. Any thoughts/fixes will be highly appreciated. Thanks

Comment on CGI::Application redirect not working
Select or Download Code
Re: CGI::Application redirect not working (cgi/nph)
by Anonymous Monk on Mar 20, 2013 at 15:54 UTC
Re: CGI::Application redirect not working
by sundialsvc4 (Monsignor) on Mar 20, 2013 at 17:22 UTC

    The best way to debug problems like this is to look at it from the client side, using a debugger such as Firebug, the Developer menu in Safari, etc.   Look at the actual content of the HTTP message that is being sent and received in each case.   Now, locate a web-site that now does what you want it to do, and compare the two exchanges.   Now you know, not only what the Perl code you’ve written is actually doing, but what it needs to do.   This gives you a specific target to shoot for ... and if the perldocs don’t tell you, the source-code will.

Re: CGI::Application redirect not working
by saberworks (Curate) on Mar 20, 2013 at 23:57 UTC
    I have a redirect method in my CGI::Application base class that looks like this:
    sub redirect { my ($self, $location) = @_; $self->header_type('redirect'); $self->header_add(-location => $location); return; }

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://1024530]
Front-paged by Corion
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (15)
As of 2014-07-23 10:23 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (140 votes), past polls