2007/9/28, [EMAIL PROTECTED] <[EMAIL PROTECTED]>:
> as i see there is no way to set request parameter in mod_perl2

You can rewrite an url using mp2's PerlTransHandler.
This is the sample code from book mp2 user's guide.

If the URI:
http://example.com/news/20021031/09/index.html
is now handled by:
http://example.com/perl/news.pl?date=20021031;id=09;page=index.html
the following handler can rewrite the URI in a way transparent to news.pl,
so you can still use the former URI mapping:
#file:MyApache2/RewriteURI.pm
#---------------------------
package MyApache2::RewriteURI;
use strict;
use warnings;
use Apache2::RequestRec ();
use Apache2::Const -compile => qw(DECLINED);
sub handler {
my $r = shift;
my ($date, $id, $page) = $r->uri =~ m|^/news/(\d+)/(\d+)/(.*)|;
$r->uri("/perl/news.pl");
$r->args("date=$date;id=$id;page=$page");
return Apache2::Const::DECLINED;
}
1;

Reply via email to