Website is a mirror. How to detect this programmatically in php? -
for example have 4g-market.ru mirror peterhost.ru. how can detect programmatically?
this function detects single-bounce redirect (site1 -> site2
, not site1 -> site3 -> site2
):
function isredirect($url) { $headers = get_headers($url, true); $status = $headers[0]; list($protocol, $code, $message) = split(' ', $status, 3); return ($code >= 300 && $code < 400); }
Comments
Post a Comment