So just now I was using site: and noticed that a redirect script I use which should be blocked is showing up in Google's results. In the results though it is accompanied with 'A description for this result is not available because of this site's robots.txt – learn more.' All variations of the script are showing in the index this way.
format of the script is link.php?p=word
link.php is disallowed in robots.txt
I am also, or thought, I was sending the correct headers so this would not happen in the script :
<?php
$p = $_GET['p'];
$link = array(
'linkone'=>'http://www.example.com/example.htm',
'linktwo'=>'http://www.example.com/example2.htm',
);
/*Send Headers*/
header('Content-Type: text/html; charset=utf-8');
header('X-Robots-Tag: noindex, nofollow, noarchive', true);
if (isset($link[$p]))
{
header('Location: '.$link[$p].''); // Valid URL
}
else
{
header('Location: /link/'); // Invalid URL
}
exit();
?>
I must be overlooking something... why are the different link.php?p='s showing in the Google index?