in reply to Re: How can I determine whether a URI, hostname or IP address is to the local host machine?
in thread How can I determine whether a URI, hostname or IP address is to the local host machine?

Good idea! However, it is actually a bit more complicated in my case, because my application actually represents several virtual "nodes" (not virtual hosts in the Apache sense) that are effectively making the HTTP requests. I only want to disallow requests from the same host and the same node. So somehow the web server configuration would have to pick up both my application name (MyScript in your example) and the node name from the User-Agent string, and deny access if the the node name matches the applicable part of the URI.

The downside of this approach is that I don't really want to deny access if the URI is to the local host and same node. It would be much more user friendly if I could instead simply convert the URI to a local file access and avoid issuing the request at all.

  • Comment on Re^2: How can I determine whether a URI, hostname or IP address is to the local host machine?