When I call the following:
file_get_contents('http://whgfdw.ca');
or
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'http://whgfdw.ca');
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_exec($ch);
The return value is the HTML of the homepage of the main site located on the local (dedicated) webserver. I would be grateful if anyone could help me understand this? Perhaps there is something I'm overlooking.
I can't use simple URL validation because http://whgfdw.ca
is a perfectly fine URL; it just doesn't have a DNS entry.
My ideal functionality is to be able to catch a DNS lookup failure or a 404 or a case of no content and then act on it. Thanks!