Jess O'Leary wrote:
> I'm working on a link-checker type application, and can't figure
> something out for the life of me. I'm using simple stuff like:
> 
> if (head($url)) {
>     # ok document exists
> }
> 
> ... but it doesn't seem to work on any interal
> links. I've come to the conclusion that the fact
> that I'm running this on a virtual domain with a
> shared IP address must have something to do with
> it. I've tried using GET with the same problem.

Your description of the problem is not very accurate.

> My question is, when I use HEAD and/or GET does
> LWP actually use the IP address as opposed to the
> hostname? That's the only thing I can think of.

The LWP manpage says :

  The library automatically adds a "Host" and a "Content-
  Length" header to the HTTP request before it is sent over
  the network.

The "Host" header is the host name specified in the requested URL. It is
used by (recent) web servers to determine which virtual domain should be
used when several domains are hosted on the same machine. Thus, the answer
to your question is close to "no".

> If so, what is the work-around to be able to
> GET internal documents on a virtual domain that
> is using the same IP address as another site?

I don't know. Can you produce a test case?

-- 
Rafael Garcia-Suarez

Reply via email to