HTTP Response Header Checker

HTTP Response Header Checker

FAIL, “.$url.” does not exist”;
} else {
if(empty($info[“path”])) {
$info[“path”] = “/”;
}
$query = “”;
if(isset($info[“query”])) {
$query = “?”.$info[“query”].””;
}
$out = “HEAD “.$info[“path”].””.$query.” HTTP/1.1\r\n”;
$out .= “Host: “.$info[“host”].”\r\n”;
$out .= “Connection: close \r\n”;
$out .= “User-Agent: RJPargeter.com Response Header Checker v1.0 – rjpargeter.com/contact for feedback\r\n\r\n”;
fwrite( $fp, $out );
$html = “”;
while ( !feof( $fp ) ) {
$html .= fread( $fp, 8192 );
}
fclose( $fp );
}
if(!$html) {
$message = “FAIL, “.$url.” does not exist”;
} else {
$headers = explode(“\r\n”, $html);
unset($html);
for($i=0;isset($headers[$i]);$i++ ) {

//if(preg_match(“/HTTP\/[0-9A-Za-z +]/i” ,$headers[$i])) {
// $status .= preg_replace(“/http\/[0-9]\.[0-9]/i”,””,$headers[$i]);
//}
}
//$message = $status.” “.$response_array[$status];
}
}
?>
The HTTP Response is the information returned in the HTTP Protocol when you access URL’s over the Internet. Google, Yahoo and in fact all browsers rely on this information to determine if the information you are trying to access has been found or if not what may of happened to it.

The full HTTP response contains a variety of information that a web server will send in response to a HTTP request. This information can yield interesting information such as the web server a site is hosted upon, the scripting language used and most importantly the response code. The following search box allows you to enter a URL and see the full HTTP Response.

Why is this useful you may be thinking? Well Google, etc rely on the response codes to determine if they index your site. For a resource to be indexed you will most often than not be looking for a ‘200 ok’ response. If a page is missing you may get a ‘404 page not found’. If a page has gone you may look for a ‘410 Gone’ response to be sent back.

Feel free to use this tool I have developed to test your URL’s HTTP response:

Domain:


Response Code:“;
for($i=0;isset($headers[$i]);$i++ ) {
echo “
” , $headers[$i];
}

} else {
echo “Response Code:
“;
echo $message;
}

?>

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.