Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

merlyn (47)

merlyn
  merlyn@stonehenge.com
http://www.stonehenge.com/merlyn/
AOL IM: realmerlyn (Add Buddy, Send Message)
Yahoo! ID: realmerlyn (Add User, Send Message)

PAUSE-ID: MERLYN [cpan.org].
See my home page [stonehenge.com].

Journal of merlyn (47)

Tuesday December 03, 2002
11:15 AM

internal redirect, apache mod_cgi, and CGI.pm

[ #9247 ]
Recently, there's been a discussion on PerlMonks about how an internal redirect wasn't working. I traced it down to a few lines of mod_cgi.c in the Apache source code. For an internal redirect, a location header must be present, begin with a slash (no hostname) and the status must be 200.

Unfortunately, the standard CGI.pm redirect routine defaults the status to be 302. Thus, you have to remember to write the redirect as

print redirect(-uri => '/new/location', -status => 200);

{sigh}

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.