How can I tell if a certain URL exists? I see there are a few ways to do this with PHP but I can’t get any of them to work with an absolute URL. I can check for files on my domain using a relative path, but not with an absolute path.
Also, the file I’m checking for is on a subdomain of the domain where the PHP file lives that is executing the check, and the subdomain is not on the same web server. I CAN NOT use response headers in my case.
I’m executing filecheck.php from https://myserver.com, checking for a file at http://subdomain/myserver.com.
Example from PHP.net fopen reference: $handle = fopen("http://www.example.com/", "r");
I can get this to work with “/myfile.txt”, but not with “https://myserver.com/myfile.txt”.