D
D
Den Belzarayn2016-07-17 00:11:39
PHP
Den Belzarayn, 2016-07-17 00:11:39

PHP redirect, is there any advanced features?

Such a question should be banned from indexing the link to the redirect in robots did everything, but pages with redirects stubbornly fall into the Google index.
the link is like this ../goto/link.php, and the redirect is like this

<?php $URL="http://link.com";
header("Location:$URL");
exit();
?>

Is it possible to add such a line in a php redirect as in an html redirect
<META NAME="ROBOTS" CONTENT="NOINDEX,NOFOLLOW">
so that the search engine does not scan and does not add links to redirect files to the index
Or how to make a correct redirect so that it does not fall into the search engine index?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexander Sisyukin, 2016-07-17
@Caarl

The only solution that comes to my mind is to pass the get parameter and, by its presence, display a line in the header of the page
header("Location:$URL"); // there is no such code so that the bot understands that the page has dropped out of the index header("Location:$URL" , true , your code ); /// up to one place in this situation,
if you don't want to spoil the url, then when redirecting, declare a constant, then use it to output the same string and redefine the constant after output so that there are no problems.
Robots.txt in most cases is not a panacea for closing content, since, for example, another site can place a link to your content and the bot will safely index your page. the meta tag will be the output.

V
VVB, 2016-12-21
@SEOBot

Sergey, perhaps you have errors in robots.txt
Disallow: /goto/link.php*
Try to check the results in the robots.txt section in the Google Seacrh Console (WMT)
It will clearly show if the rule is triggered for an exception, and if it does, highlight which one .

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question