Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

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!

Comment on mod_perl redirect
Re: mod_perl redirect
by Anonymous Monk on Jan 15, 2012 at 03:36 UTC
Re: mod_perl redirect
by cavac (Chaplain) 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?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://947934]
Approved by ww
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (8)
As of 2015-07-03 08:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (49 votes), past polls