Sprawdzanie osiągalności adresów url

function curlRequest($url) {
$ch=curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_TIMEOUT, 10);
curl_setopt($ch, CURLOPT_HEADER, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_NOBODY, true);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
$httpHeader = array(
"Content-Type: text/xml; charset=UTF-8",
"Content-Encoding: UTF-8"
);
curl_setopt($ch, CURLOPT_HTTPHEADER, $httpHeader);
$data=curl_exec($ch);
$info=curl_getinfo($ch);
$errno=curl_getinfo( $ch, CURLINFO_HTTP_CODE );
$finalurl=curl_getinfo( $ch, CURLINFO_EFFECTIVE_URL );
curl_close($ch);
if(preg_replace("/\/$/", "", $finalurl)==preg_replace("/\/$/", "", $url))
$finalurl = '';
return $errno.'|'.$finalurl;
}
$urls =
'www.wolakorybutowa.pl
www.adamsuszek.pl
';
$tab_urls = preg_split("/\n/", $urls, -1, PREG_SPLIT_OFFSET_CAPTURE);
for($i=0; $i $data = curlRequest('http://'.trim(chop($tab_urls[$i][0])));
$tab_urls[$i][1] = $data;
}
print_r($tab_urls);

Wykonanie kilku przekierowań 301, 302

RewriteRule ^panel/test1.php /panel/test2.php [R=301]
RewriteRule ^panel/test2.php /panel/test3.php [R=302]
RewriteRule ^panel/test3.php /panel/test4.php [R=301]
RewriteRule ^panel/test4.php /panel/test5.php [R=302]
RewriteRule ^panel/test5.php /panel/test6.php [R=301]

przydatne do testów
plik test6.php:
<? sleep(20); ?>
OK