I'm using PHP to check if an .html file exists on the server. However, @get_headers seems to be "visiting" the page when it checks for the file, and my tracking script that produces an analytics report is picking that up as a page view. Is there another way to check if the file exists without that happening? Here's the code I'm using now:
$file = "https://www." . $_SERVER['HTTP_HOST'] . $row['page'];
$file_headers = @get_headers($file);
if(!$file_headers || $file_headers[0] == 'HTTP/1.1 404 Not Found') {
$file_exists = false;
}
else {
$file_exists = true;
}