Adam Ness wrote:

> For some odd reason, Apache::URI::hostname is showing up as blank.  I've 
> tried reading the various man pages and the Oriley book, but I can't 
> find any explanation for why hostname would be blank..  Am I overlooking 
> something?


yes :)  see Recipe 5.3 in the cookbook for the complete lowdown, but I'm 
pretty sure it's there in the eagle as well...

for the moment, though, know that there are two ways of getting an 
Apache::URI object:

   my $uri = $r->parsed_uri;
   my $uri = Apache::URI->parse($r);

parsed_uri() will only return the scheme, port, and hostname if the 
incoming URI is an absolute URI (which is typically the case with 
proxies but atypical for most of your programing).

Apache::URI->parse($r) tries to find what it can from the request, then 
it makes decisions based on what else Apache knows about the server. 
typically this will involve populating $uri->hostname but, as someone 
brought up just recently, if you use a _default_ vhost config you'll get 
   '_default_' for the hostname.

there are other differences between the two methods, but this is what 
you're interested in now...

--Geoff

Reply via email to