|redirect script with noindex, nofollow, noarchive|
Proper way to accomplish this?
| 9:39 pm on Sep 6, 2012 (gmt 0)|
Looking to use a php redirect script for my site and I do not want the page to be indexed, followed, archived, etc.
I have disallowed the /goto.php page in my robots.txt, however, Google also states if other sites link to this page it could still be picked up.
|To entirely prevent a page's contents from being listed in the Google web index even if other sites link to it, use a noindex meta tag or x-robots-tag. As long as Googlebot fetches the page, it will see the noindex meta tag and prevent that page from showing up in the web index. The x-robots-tag HTTP header is particularly useful if you wish to limit indexing of non-HTML files like graphics or other kinds of documents. |
So, is my implementation of the x-robots-tag below correct and will this accomplish what I am looking for?
Use the following link format:
$p = $_GET['p'];
$link = "/widget1.htm";
$link = "/default.htm";
header("X-Robots-Tag: noindex, nofollow, noarchive", true);
| 9:48 pm on Sep 6, 2012 (gmt 0)|
Use the Live HTTP Headers extension for Firefox to see the actual header your server returns.
You'll also see your redirect is a 302 redirect.
Rather than case statements, the code can be easier to maintain if you use an array for the URL pairs.
| 10:05 pm on Sep 6, 2012 (gmt 0)|
Already did that and looks fine :
HTTP/1.1 302 Found
X-Robots-Tag: noindex, nofollow, noarchive
minus all the other headers.
I guess I was asking more if this would be the preferred method so Google is not indexing the link or passing anything on? This seems a much better method to me than manually adding a rel=nofollow all over the site and makes managing the links much easier.
Would using a 301 perm be better for any reason?
I didn't think about using an array as this was the first thing to pop in my head, but yeah, it would clean it up a bit.