Possible Duplicate:
How can one check to see if a remote file exists using PHP?
I want to programatically check if a website is live or not. I know i can do this by opening the url using “cURL” or “fopen” but it takes a lot of time because it needs to fetch the full page.
Furthermore, this method is not reliable because there can be other reasons like unsupported protocols to be able to open the website.
Is there any other way??
You could simply use HEAD request to get only the headers of the page and not the whole page. Still, the website will still generate the full page but at least you won’t download everything.
To achieve this, you can use many methods, just check how to change the headers of the request and instead of doing a GET, you can do a HEAD.