Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

mod_perl redirect

by srchulo (Sexton)
on Jan 15, 2012 at 02:59 UTC ( [id://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 (Parson) 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
Domain Nodelet?
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?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (4)
As of 2024-04-24 03:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found