Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much

mod_perl redirect

by srchulo (Sexton)
on Jan 15, 2012 at 02:59 UTC ( #947934=perlquestion: print w/replies, xml ) Need Help??
srchulo has asked for the wisdom of the Perl Monks concerning the following question:

So I'm working in a mod_perl environment, and I want to know what the best way is to redirect to a new url. I know in CGI Perl you use print "Location:...", however I've come to find that usually there are better ways to do things in mod_perl, but I can't seem to find anything. Thanks in advance!

Replies are listed 'Best First'.
Re: mod_perl redirect
by Anonymous Monk on Jan 15, 2012 at 03:36 UTC
Re: mod_perl redirect
by cavac (Deacon) on Jan 15, 2012 at 08:41 UTC

    It's pretty much the same all around. You are generating a "Location" HTTP header and are (hopefully) using the correct HTTP status code, depending on what exactly you are trying to do.

    Here's the definition of HTTP/1.1 status codes, look at 303 and 307. The main difference between those is how POST is handled.

    "Believe me, Mike, I calculated the odds of this succeeding against the odds I was doing something incredibly stupidů and I went ahead anyway." (Crow in "MST3K The Movie")

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://947934]
Approved by ww
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (5)
As of 2018-06-25 07:02 GMT
Find Nodes?
    Voting Booth?
    Should cpanminus be part of the standard Perl release?

    Results (126 votes). Check out past polls.