Geoffrey Young wrote:

to generate a URI that points to the same server as the current request it's best to use Apache::URI methods, which are pretty easy.

  my $uri = Apache::URI->parse($r);
  $uri->path('/some/new/document.html');
  my $absolute_uri = $uri->unparse;

note that calling path() (or any other method) is optional - you don't need to change anything in order to unparse() the URI and get an absolute URI back.

So basically it's:


my $absolute_uri = Apache::URI->parse($r)->unparse;

So just a heads up for mp2, there is a new method to do that:

use Apache::URI ();
my $absolute_uri = $r->construct_url();

__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com



Reply via email to