Forum Moderators: phranque
At heart, the PHP script on domain2 is something like:
<?php
$url=$_GET["url"];
header("HTTP/1.1 301 Moved Permanently");
header("Location: ".$url);
?>
At the root of domain2 I have a robots.txt file that looks like:
User-agent: *
Disallow: /
What I want is for domain2 to not show up in the search engines, but to be able to pass "link love" to the pages I link to.
Because I'm using a PHP redirect, which is what I want to keep, I can't use a meta tag to noindex,follow, but can I set my robots.txt file to something like that, or to send a PHP header that gives the same message?
Thanks
Search engines generally like to index only URLs that directly return "200 OK".
Your robots.txt exclusion stops them seeing the redirect because they are disallowed from spidering the URLs that return the redirect code.