You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Ian Joyce <Ij...@aafp.org> on 2004/02/13 14:46:16 UTC
Current URL
This may be day 1 stuff for most of you, but...
What's the quckest way to determine the URL that made the current request in mod_perl 1?
--
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html
Re: Current URL
Posted by Geoffrey Young <ge...@modperlcookbook.org>.
Ian Joyce wrote:
> This may be day 1 stuff for most of you, but...
>
> What's the quckest way to determine the URL that made the current request in mod_perl 1?
you are probably looking for this:
my $uri = Apache::URI->parse($r)->unparse;
if you don't need a full uri (with the scheme, port, etc) then you can
simply use
my $uri = $r->parsed_uri->unparse;
if you don't care about the query string then you can even use
my $uri = $r->uri;
some things in Chapter 5 in the mod_perl cookbook might help as well as you
try to manipulate the uri.
http://www.modperlcookbook.org/
HTH
--Geoff
--
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html
Re: Current URL
Posted by David Wright <da...@dexy.org>.
> It's:
> --------------------8<--------------------
> $r->connection->remote_ip
> --------------------8<--------------------
That'd be the ip of the client making the request.
> Ian Joyce wrote:
> > This may be day 1 stuff for most of you, but...
> >
> > What's the quckest way to determine the URL that made the current
> request in mod_perl 1?
> >
I'd have said $r->uri, which gives the current uri.
If you want the referrer (the question is a little ambiguous), then:
$r->header_in( 'Referer' );
HTH,
dave
--
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html
Re: Current URL
Posted by Tom Schindl <to...@gmx.at>.
It's:
--------------------8<--------------------
$r->connection->remote_ip
--------------------8<--------------------
See:
http://perl.apache.org/docs/1.0/api/Apache.html#_c____r_E_gt_connection
Ian Joyce wrote:
> This may be day 1 stuff for most of you, but...
>
> What's the quckest way to determine the URL that made the current request in mod_perl 1?
>
>
--
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html